/*
 * LiveMind/Video Search-specific styles
 * Base styles from: https://mcpcio.com/shared/css/mcpcio-core.css
 */

:root {
    --charcoal-primary: #1a1a1a;
    --charcoal-secondary: #2d2d2d;
    --charcoal-tertiary: #3d3d3d;
    --gold-primary: #f59e0b;
    --gold-secondary: #fbbf24;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #22c55e;
    --error-color: #ef4444;
    --red-live: #dc2626;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--charcoal-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    background: linear-gradient(135deg, var(--charcoal-primary) 0%, var(--charcoal-secondary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.header-logo img {
    height: 40px;
    width: auto;
}

.header-logo span {
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 220px;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    margin-top: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    min-height: 44px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.tier-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gold-primary);
    background: rgba(245, 158, 11, 0.15);
    border-radius: 20px;
    margin-left: 0.5rem;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #2c5530, #3a6e3f);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.user-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.user-button.admin {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.livemind-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Search Section */
.search-section {
    text-align: center;
    padding: 2rem 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.search-input-wrapper {
    display: flex;
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--gold-secondary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    min-height: 48px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    background: var(--gold-gradient);
    border: none;
    padding: 1rem 1.25rem;
    color: var(--charcoal-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    opacity: 0.9;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.tab:hover {
    background: var(--charcoal-tertiary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--gold-gradient);
    color: var(--charcoal-primary);
    border-color: transparent;
}

/* Results Section */
.results-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Transcript Teaser */
.transcript-teaser {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.transcript-teaser.hidden {
    display: none;
}

.lock-icon {
    font-size: 1.25rem;
}

#teaserText {
    flex: 1;
    color: var(--gold-secondary);
    font-size: 0.9rem;
}

.upgrade-link {
    color: var(--gold-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.upgrade-link:hover {
    text-decoration: underline;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Video Card */
.video-card {
    background: var(--charcoal-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--gold-primary);
}

.video-card.transcript-result {
    border-color: rgba(245, 158, 11, 0.4);
}

.thumbnail-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.7);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timestamp-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: var(--gold-gradient);
    color: var(--charcoal-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.video-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.transcript-snippet {
    font-size: 0.8rem;
    color: var(--gold-secondary);
    font-style: italic;
    margin: 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading and Empty States */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.app-footer a {
    color: var(--gold-secondary);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--charcoal-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }

    .header-nav.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: rgba(0, 0, 0, 0.2);
        margin-top: 0.5rem;
        border-radius: 8px;
    }

    .nav-dropdown.active .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.active:hover .nav-dropdown-menu {
        display: block;
    }

    .user-button {
        width: 100%;
        justify-content: space-between;
    }

    .header-container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .search-section {
        padding: 1.5rem 0.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .category-tabs {
        gap: 0.375rem;
    }

    .tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }

    .results-section {
        padding: 1rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .transcript-teaser {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header-logo span {
        font-size: 1rem;
    }

    .header-logo img {
        height: 32px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .video-info {
        padding: 0.875rem;
    }

    .video-title {
        font-size: 0.9rem;
    }
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.load-more-container.hidden {
    display: none;
}

.load-more-btn {
    display: inline-block;
    background: var(--gold-gradient);
    color: var(--charcoal-primary);
    border: 2px solid var(--gold-primary);
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

