/* Main stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

header {
    padding: 40px 20px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    text-align: left;
}

.header-left h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-left p {
    font-size: 1.2em;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.user-name {
    font-weight: 500;
    font-size: 0.9em;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 20px 20px 0 0;
    min-height: 70vh;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .header-left {
        text-align: center;
    }

    .header-left h1 {
        font-size: 2em;
    }

    .header-left p {
        font-size: 1em;
    }

    .user-menu {
        flex-direction: column;
        gap: 10px;
        padding: 15px 20px;
    }

    main {
        margin: 0 10px;
        padding: 15px;
        border-radius: 15px 15px 0 0;
    }
}

/* Bra
nd Setup Section */
.brand-setup-section {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

.brand-setup-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 20px;
}

.brand-setup-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.brand-setup-card p {
    color: #666;
    margin-bottom: 20px;
}

.brand-setup-card button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.brand-setup-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.brand-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.brand-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.brand-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Brand Setup Form */
.brand-form-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

.brand-form-container h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
}

.form-section h4 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: #f0f0f0;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-item.selected {
    background: #e3f2fd;
    border-color: #667eea;
}

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover {
    background: #f0f0f0;
}

.radio-item input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

.radio-item.selected {
    background: #e3f2fd;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.form-error {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
}

.form-success {
    color: #28a745;
    font-size: 0.9em;
    margin-top: 5px;
}

.f orm-message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Influencer Discovery with Alignment Scoring */
.influencer-discovery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.influencer-discovery h3 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

.brand-profile-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.brand-profile-section h4 {
    color: #495057;
    margin-bottom: 15px;
}

.brand-summary {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.brand-summary h5 {
    color: #28a745;
    margin-bottom: 10px;
}

.brand-summary p {
    margin: 5px 0;
    color: #6c757d;
}

.status-success {
    color: #28a745;
    font-weight: 500;
}

.status-error {
    color: #dc3545;
    font-weight: 500;
}

.status-warning {
    color: #ffc107;
    font-weight: 500;
}

.search-filters {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-filters h4 {
    color: #495057;
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.filter-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.filter-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-actions button:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.filter-actions button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.filter-actions button:last-child {
    background: #6c757d;
    color: white;
}

.filter-actions button:last-child:hover {
    background: #5a6268;
}

.alignment-legend {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #bbdefb;
}

.alignment-legend h4 {
    color: #1565c0;
    margin-bottom: 15px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e3f2fd;
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-text strong {
    color: #333;
}

.legend-text small {
    color: #6c757d;
}

.discovery-results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.results-header h4 {
    color: #495057;
    margin: 0;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-controls label {
    font-weight: 500;
    color: #495057;
}

.results-controls select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background: white;
}

.influencer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.influencer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.influencer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.influencer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.influencer-info h5 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.influencer-info .full-name {
    color: #6c757d;
    margin: 0;
    font-size: 0.9em;
}

.alignment-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
}

.score-value {
    font-size: 1.2em;
    line-height: 1;
}

.score-label {
    font-size: 0.7em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.influencer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.stat-label {
    display: block;
    color: #6c757d;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.influencer-bio {
    margin-bottom: 15px;
}

.influencer-bio p {
    color: #495057;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
}

.alignment-breakdown {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alignment-breakdown h6 {
    color: #495057;
    margin: 0 0 8px 0;
    font-size: 0.9em;
}

.breakdown-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.breakdown-items span {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    color: #495057;
    border: 1px solid #dee2e6;
}

.breakdown-items .boost {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.influencer-actions {
    display: flex;
    gap: 10px;
}

.influencer-actions button {
    flex: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.influencer-actions button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.influencer-actions button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.influencer-actions button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.influencer-actions button:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.influencer-actions button:disabled:hover {
    background: #e9ecef;
    transform: none;
    box-shadow: none;
}

.loading-state,
.error-state,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-state button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.error-state button:hover {
    background: #c82333;
}

/* Influencer Modal */
.influencer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.influencer-details p {
    margin: 8px 0;
    color: #495057;
}

.influencer-details strong {
    color: #333;
}

.bio-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.bio-section h4 {
    color: #333;
    margin-bottom: 10px;
}

.bio-section p {
    color: #495057;
    line-height: 1.5;
}

/* Responsive Design for Discovery */
@media (max-width: 768px) {
    .influencer-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .influencer-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .alignment-score {
        align-self: center;
    }

    .legend-items {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/ * AI Content Display Improvements */ .ai-formatted-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ai-formatted-content h2,
.ai-formatted-content h3,
.ai-formatted-content h4 {
    color: #495057;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.ai-formatted-content h2 {
    font-size: 1.25em;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 4px;
}

.ai-formatted-content h3 {
    font-size: 1.1em;
    color: #6c757d;
}

.ai-formatted-content h4 {
    font-size: 1em;
    color: #868e96;
}

.ai-formatted-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.ai-formatted-content li {
    margin: 6px 0;
    list-style-type: disc;
}

.ai-formatted-content strong {
    color: #495057;
    font-weight: 600;
}

.ai-formatted-content p {
    margin: 12px 0;
}

.ai-result {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.ai-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.ai-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ai-actions button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ai-actions button:nth-child(2) {
    background: #6c757d;
}

.ai-timestamp {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
    text-align: right;
}

.ai-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #6c757d;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.ai-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

/* Responsive AI content */
@media (max-width: 768px) {
    .ai-formatted-content {
        padding: 15px;
        font-size: 14px;
    }

    .ai-actions {
        flex-direction: column;
    }

    .ai-actions button {
        width: 100%;
    }
}

/* Scrollbar styling for AI content */
.ai-formatted-content::-webkit-scrollbar {
    width: 8px;
}

.ai-formatted-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ai-formatted-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ai-formatted-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}