/* =============================================================================
   Veylor AI Dashboard Styles
   Extracted from veylor.html for maintainability
   ============================================================================= */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* =============================================================================
   Table of Contents - Premium Styling
   ============================================================================= */

.toc-container {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.toc-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #10b981);
    opacity: 0.8;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.toc-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.toc-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.toc-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-links-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

@media (max-width: 600px) {
    .toc-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.toc-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.toc-link i {
    font-size: 1.25rem;
    transition: transform 0.25s ease;
}

.toc-link span {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.toc-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.toc-link:hover i {
    transform: scale(1.15);
}

.toc-link:active {
    transform: translateY(-1px);
}

/* Age - Blue */
.toc-link-age {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.toc-link-age:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

/* Gender - Pink */
.toc-link-gender {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.08);
}

.toc-link-gender:hover {
    background: rgba(236, 72, 153, 0.2);
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.2);
}

/* Ethnicity - Teal */
.toc-link-ethnicity {
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.08);
}

.toc-link-ethnicity:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: rgba(20, 184, 166, 0.4);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.2);
}

/* Merchandise - Green */
.toc-link-merch {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.toc-link-merch:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

/* Families - Amber */
.toc-link-family {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.toc-link-family:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
}

/* Social - Purple */
.toc-link-social {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
}

.toc-link-social:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2);
}

/* Choices.js Dark Theme Overrides */
.choices {
    margin-bottom: 0;
}

.choices__inner {
    background: var(--bg-body) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    padding: 8px 12px !important;
    min-height: 42px !important;
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
}

.choices__list--single {
    padding: 0 16px 0 0 !important;
    display: flex;
    align-items: center;
}

.choices__list--single .choices__item {
    padding: 0 !important;
}

.choices__list--dropdown {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    z-index: 100 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    margin-top: 4px !important;
}

.choices__list--dropdown .choices__item {
    padding: 10px 14px !important;
    color: var(--text-main) !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: rgba(var(--primary-rgb), 0.15) !important;
    color: var(--text-main) !important;
}

.choices__input {
    background: transparent !important;
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
}

.choices__input::placeholder {
    color: var(--text-muted) !important;
}

.choices__placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

.choices[data-type*="select-one"] .choices__input {
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--border) !important;
    background: var(--bg-body) !important;
}

.choices[data-type*="select-one"]::after {
    border-color: var(--text-muted) transparent transparent transparent !important;
    right: 14px !important;
}

.choices.is-open[data-type*="select-one"]::after {
    border-color: transparent transparent var(--text-muted) transparent !important;
}

/* Uniform padding for dropdown items */
.choices__list--dropdown .choices__item {
    padding: 12px 16px !important;
}

/* Custom option with logo */
.choice-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.choice-option-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-body);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.choice-option-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.choice-option-logo i {
    font-size: 12px;
    color: var(--text-muted);
}

.choice-option-text {
    flex: 1;
    overflow: hidden;
}

.choice-option-name {
    font-weight: 500;
    color: var(--text-main);
}

.choice-option-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.choice-option-badge {
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 99px;
    font-weight: 600;
    flex-shrink: 0;
}

/* =============================================================================
   Veylor AI Theme - Layout
   ============================================================================= */

.veylor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    min-height: calc(100vh - 200px);
    align-items: start;
}

@media (max-width: 1100px) {
    .veylor-container {
        grid-template-columns: 1fr;
    }
}

.veylor-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent grid blowout from flex children */
    overflow: hidden;
    /* Ensure content doesn't overflow panel */
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.panel-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.panel-icon.vision {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.panel-icon.sentiment {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

/* =============================================================================
   Drag Drop Zone
   ============================================================================= */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-body);
    margin-bottom: 24px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone.dragover {
    transform: scale(1.02);
}

.drop-zone-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.dragover .drop-zone-icon {
    color: var(--primary);
}

.drop-zone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}

.drop-zone-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* =============================================================================
   Image Preview Grid
   ============================================================================= */

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.preview-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-body);
}

.preview-item .image-wrapper {
    position: relative;
    aspect-ratio: 1;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.preview-item:hover .remove-btn {
    opacity: 1;
}

.preview-item .comment-input {
    width: 100%;
    padding: 8px;
    border: none;
    border-top: 1px solid var(--border);
    background: transparent;
    font-size: 0.8rem;
    color: var(--text-main);
    resize: none;
}

.preview-item .comment-input::placeholder {
    color: var(--text-muted);
}

/* =============================================================================
   Analyze Button
   ============================================================================= */

.analyze-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.analyze-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   Analysis Results
   ============================================================================= */

.analysis-results {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.results-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 6px 0;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.result-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    line-height: 1.5;
}

/* =============================================================================
   Sentiment Panel
   ============================================================================= */

.sentiment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.sentiment-card {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.sentiment-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.sentiment-emoji {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.sentiment-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.sentiment-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.sentiment-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    margin-top: 8px;
}

.sentiment-trend.positive {
    background: var(--success-bg);
    color: var(--success);
}

.sentiment-trend.negative {
    background: var(--danger-bg);
    color: var(--danger);
}

/* =============================================================================
   Mentions
   ============================================================================= */

.mentions-section {
    margin-top: 24px;
}

.mentions-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mention-item {
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.mention-item.positive {
    border-left-color: var(--success);
}

.mention-item.negative {
    border-left-color: var(--danger);
}

.mention-item.neutral {
    border-left-color: var(--warning);
}

.mention-text {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.mention-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.mention-source {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================================================
   Loading States
   ============================================================================= */

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--bg-hover) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.empty-state-panel {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-panel i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.file-input {
    display: none;
}

/* =============================================================================
   AI Overlay Effects
   ============================================================================= */

.ai-overlay-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.ai-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.8;
    animation: scan 3s linear infinite;
    z-index: 2;
    box-shadow: 0 0 10px var(--primary);
}

@keyframes scan {
    0% {
        top: -5%;
    }

    100% {
        top: 105%;
    }
}

.ai-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    z-index: 2;
}

.ai-corner-tl {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.ai-corner-tr {
    top: 10px;
    right: 10px;
    border-left: none;
    border-bottom: none;
}

.ai-corner-bl {
    bottom: 10px;
    left: 10px;
    border-right: none;
    border-top: none;
}

.ai-corner-br {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
}

.ai-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
}

/* =============================================================================
   Tabs
   ============================================================================= */

.tabs-header {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 4px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   Overview Section
   ============================================================================= */

.overview-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.overview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0.5;
}

.overview-card.image::before {
    background: linear-gradient(90deg, #8b5cf6, #d946ef);
}

.overview-card.video::before {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.overview-card.social::before {
    background: linear-gradient(90deg, #10b981, #f59e0b);
}

.overview-card.demographics::before {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.overview-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.overview-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bg-body);
    color: var(--text-main);
}

.overview-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.overview-stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 4px;
}

.overview-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.overview-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-body);
    color: var(--text-muted);
    align-self: flex-start;
}

.overview-card.active .overview-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* =============================================================================
   Logos Carousel
   ============================================================================= */

.logos-carousel-section {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 24px;
    background: transparent;
    overflow: hidden;
}

.carousel-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.logo-marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    /* Fade edges */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    width: max-content;
    /* Ensure it takes full width of content */
    animation: scroll 40s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

.marquee-content img {
    height: 50px;
    width: auto;
    margin: 0 30px;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
    vertical-align: middle;
}

.marquee-content img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.33%);
        /* Move 1/3 since we triplicated */
    }
}