:root {
    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Refined Color Palette */
    --gold: #D4AF37;
    --gold-dark: #B8860B;
    --gold-light: rgba(212, 175, 55, 0.12);
    --purple: #6B21A8;
    --purple-deep: #4C1D95;
    --purple-light: rgba(107, 33, 168, 0.08);
    --purple-glow: rgba(107, 33, 168, 0.15);

    /* Neutral Tones */
    --black: #1C1917;
    --gray: #57534E;
    --gray-light: #78716C;
    --light-gray: #F7F5F3;
    --white: #FFFCF9;
    --border-subtle: rgba(0, 0, 0, 0.06);

    --max-width: 1400px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 16px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.08), 0 24px 48px rgba(0,0,0,0.1);
}

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

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--black);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 252, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--purple);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--purple);
}

.nav-links .nav-highlight {
    color: #FFA500;
    font-weight: 600;
}

.nav-links .nav-highlight:hover {
    color: #FFD700;
}

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--black);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Breadcrumb */
.breadcrumb {
    padding: 6rem 2rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.breadcrumb a {
    color: var(--gray);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--purple);
}

.breadcrumb span {
    color: var(--gray);
    margin: 0 0.5rem;
}

/* Page Header */
.page-header {
    padding: 7rem 2rem 3rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-header h1 {
    font-size: 2.75rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    color: var(--black);
    line-height: 1.15;
}

.page-header .subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-style: italic;
}

.page-header .description {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    color: var(--gray);
}

/* Search & Filters */
.search-filters {
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 12px;
    margin-bottom: 3rem;
    border: 1px solid var(--border-subtle);
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
}

.search-box input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.1);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--purple);
    color: var(--purple);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
    border-color: var(--purple);
    color: #fff;
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.25);
}

/* Grid Layouts */
.grid-container {
    padding: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-subtle);
}

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

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--purple-light);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.card-content {
    padding: 1.5rem;
}

.card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--purple-light);
    color: var(--purple);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--black);
    line-height: 1.3;
}

.card-description {
    font-size: 0.875rem;
    color: var(--gray);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.875rem;
    color: var(--gray);
    display: flex;
    justify-content: space-between;
}

/* Defensive rule: Never show transcript or large descriptions in video card thumbnails */
.card[href*="/videos/"] .transcript,
.card[href*="/videos/"] .card-description {
    display: none !important;
}

/* Video Page Specific */
.video-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

.video-player {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-details {
    max-width: 900px;
    margin: 0 auto;
}

.video-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.video-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.video-meta-item {
    display: flex;
    flex-direction: column;
}

.video-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.video-meta-value {
    font-size: 1rem;
    color: var(--black);
}

.video-meta-value a {
    color: var(--purple);
    text-decoration: none;
}

.video-meta-value a:hover {
    text-decoration: underline;
}

.section-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--black);
}

.transcript,
.description-section,
.summary-section {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.transcript p,
.description-section p,
.summary-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.major-points {
    background: var(--purple-light);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--purple);
}

.major-points ul {
    margin-left: 1.5rem;
}

.major-points li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* Related Videos */
.related-videos {
    margin-top: 4rem;
    padding: 3rem 2rem;
    background: var(--light-gray);
}

.related-videos h2 {
    font-size: 2rem;
    font-weight: 300;
    text-align: center;
    margin-bottom: 2rem;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--purple);
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    padding: 3rem 2rem;
    background: #1a1a1a;
    color: #ffffff;
    margin-top: 4rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: #FFD700;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section a {
    display: block;
    color: #a0a0a0;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #ffffff;
}

.footer-section p {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #333;
    text-align: center;
    color: #a0a0a0;
    font-size: 0.9rem;
}

footer p {
    color: var(--gray);
    margin-bottom: 0.5rem;
}

/* ========== RESPONSIVE NAVIGATION ========== */

/* Large tablets and small desktops (1024px and below) */
@media (max-width: 1024px) {
    .nav-container {
        padding: 1.25rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* Tablets (900px and below) */
@media (max-width: 900px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .btn-secondary span {
        display: none;
    }
}

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

    .nav-container {
        padding: 1rem 1.25rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 5rem 2rem 2rem;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-links a:last-of-type {
        border-bottom: none;
    }

    .nav-links .btn-secondary {
        margin-top: 1.5rem;
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1rem;
    }

    .nav-links .btn-secondary span {
        display: inline;
    }

    .nav-links .btn-icon {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 1.5rem;
        background: var(--light-gray);
        border-radius: 8px;
    }

    .nav-links .bookmarks-toggle {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }

    /* Page content adjustments */
    .page-header h1 {
        font-size: 2rem;
    }

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

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .video-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .page-header {
        padding: 5rem 1.5rem 2rem;
    }

    .grid-container {
        padding: 1.5rem;
    }

    .breadcrumb {
        padding: 5rem 1.5rem 1.5rem;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.875rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-links {
        width: 100%;
        right: -100%;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .page-header {
        padding: 4.5rem 1rem 1.5rem;
    }

    .page-header .subtitle {
        font-size: 1rem;
    }

    .grid-container {
        padding: 1rem;
    }

    .section-heading {
        font-size: 1.25rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
    .logo {
        font-size: 1rem;
    }

    .menu-toggle {
        width: 24px;
        height: 18px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.loading::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Pro-Indigenous Badge */
.pro-indigenous {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #8B00FF, #6200cc);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 1rem;
}

/* Indigenous Voice Badge - Tier 1 (Highest priority - stories BY indigenous people) */
.indigenous-voice {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-left: 1rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: subtle-glow 3s ease-in-out infinite;
}

.indigenous-voice::before {
    content: '🗣️ ';
}

/* Indigenous Language Badge - Tier 2 */
.indigenous-language {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #00CED1, #20B2AA);
    color: var(--white);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.indigenous-language::before {
    content: '🌍 ';
}

/* Language tags */
.language-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    text-transform: capitalize;
}

@keyframes subtle-glow {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(255, 215, 0, 0.6); }
}

/* Video Page Styles */
.video-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.video-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.video-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    flex: 1;
}

.badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.video-container {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
    background: var(--black);
}

.video-container iframe {
    display: block;
}

.video-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background: var(--light-gray);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
}

.metadata-item strong {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.metadata-item a {
    color: var(--purple);
    text-decoration: none;
}

.metadata-item a:hover {
    text-decoration: underline;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--black);
}

.content-section p {
    line-height: 1.8;
    color: var(--black);
}

.transcript {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.related-videos.grid-3 {
    margin-top: 1rem;
}

.video-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid var(--border-subtle);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.video-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--purple-light);
}

.video-card-content {
    padding: 1.5rem;
}

.video-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--black);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .video-meta {
    font-size: 0.875rem;
    color: var(--gray);
    margin: 0;
    padding: 0;
    border: none;
}

@media (max-width: 768px) {
    .video-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .video-header h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .badge {
        margin-left: 0;
    }

    .video-metadata {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    --white: #1a1a1a;
    --black: #e0e0e0;
    --light-gray: #2a2a2a;
    --gray: #a0a0a0;
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode nav {
    background: #1a1a1a;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode .menu-toggle span {
    background: #e0e0e0;
}

body.dark-mode .nav-links {
    background: #1a1a1a;
}

body.dark-mode .nav-links a {
    border-bottom-color: #2a2a2a;
}

body.dark-mode .nav-links .btn-icon {
    background: #2a2a2a;
}

body.dark-mode .nav-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .card {
    background: #2a2a2a;
}

body.dark-mode .stat-card {
    background: #2a2a2a;
}

body.dark-mode .search-box input,
body.dark-mode .filter-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode .collection-card {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

/* Button Styles */
.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--purple);
    border: 1.5px solid var(--purple);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.btn-secondary:hover {
    background: var(--purple);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.25);
}

/* Primary Button */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(107, 33, 168, 0.25);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 33, 168, 0.35);
}

/* Gold Button */
.btn-gold {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--black);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    letter-spacing: 0.01em;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.btn-icon {
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--purple-light);
    transform: scale(1.1);
}

/* Collection Cards */
.collection-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
}

.collection-card:hover {
    transform: translateY(-4px);
    border-color: var(--purple);
    box-shadow: var(--shadow-hover);
}

.collection-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.collection-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.collection-card p {
    color: var(--gray);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.collection-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--purple-light);
    color: var(--purple);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Map Customization */
#worldMap {
    transition: all 0.3s;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.leaflet-popup-content strong {
    color: var(--purple);
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.leaflet-popup-content a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

.leaflet-popup-content a:hover {
    text-decoration: underline;
}

/* Share Button Styles */
.share-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    text-decoration: none;
    color: var(--black);
}

.share-btn:hover {
    border-color: var(--purple);
    color: var(--purple);
    transform: translateY(-2px);
}

/* Watch Progress */
.video-watched {
    position: relative;
}

.video-watched::after {
    content: '✓ Watched';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--purple);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Advanced Filters */
.advanced-filters {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

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

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray);
    text-transform: uppercase;
}

select, input[type="checkbox"] {
    cursor: pointer;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    color: var(--black);
}

select:focus {
    outline: none;
    border-color: var(--purple);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
}

/* Responsive Updates for New Elements */
@media (max-width: 768px) {
    .collection-card {
        padding: 1.5rem;
    }

    .collection-icon {
        font-size: 2rem;
    }

    #worldMap {
        height: 300px !important;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Transcript Styles */
.transcript-collapsible {
    margin-top: 1rem;
}

.transcript-collapsible summary {
    cursor: pointer;
    padding: 1rem;
    background: var(--purple-light);
    border-radius: 6px;
    font-weight: 600;
    color: var(--purple);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transcript-collapsible summary::-webkit-details-marker {
    display: none;
}

.transcript-collapsible summary::before {
    content: '▶';
    transition: transform 0.3s;
    display: inline-block;
}

.transcript-collapsible[open] summary::before {
    transform: rotate(90deg);
}

.transcript-collapsible summary:hover {
    background: var(--purple);
    color: var(--white);
}

.transcript {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 0 0 8px 8px;
    line-height: 1.8;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    font-size: 1rem;
    color: var(--black);
    margin-top: 0.5rem;
}

.transcript::-webkit-scrollbar {
    width: 8px;
}

.transcript::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.transcript::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 4px;
}

.transcript::-webkit-scrollbar-thumb:hover {
    background: #7300e6;
}

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

.section-header-with-actions h2 {
    margin-bottom: 0;
}

/* Transcript Badge */
.has-transcript-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--purple-light);
    color: var(--purple);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Summary and Major Points Styles */
.summary-text {
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
    line-height: 1.8;
}

.major-points {
    background: var(--purple-light);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--purple);
    line-height: 1.8;
}

.major-points p {
    margin-bottom: 1rem;
}

.major-points ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.major-points li {
    margin-bottom: 0.75rem;
}

/* Dark mode transcript styles */
body.dark-mode .transcript {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .transcript-collapsible summary {
    background: rgba(139, 0, 255, 0.2);
}

body.dark-mode .summary-text {
    background: #2a2a2a;
}

body.dark-mode .major-points {
    background: rgba(139, 0, 255, 0.15);
}

/* BIG FACTS Section */
.big-facts-section {
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--light-gray) 100%);
    border-left: 4px solid var(--purple);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.big-facts-header {
    color: var(--purple);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.big-facts .key-facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.big-facts .key-facts-list li {
    background: var(--white);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 500;
    color: var(--black);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    padding-left: 3rem;
}

.big-facts .key-facts-list li:before {
    content: '💎';
    position: absolute;
    left: 1rem;
    font-size: 1.3rem;
}

.big-facts .key-facts-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 255, 0.15);
}

.big-facts .key-facts-list li:last-child {
    margin-bottom: 0;
}

/* Dark mode BIG FACTS */
body.dark-mode .big-facts-section {
    background: linear-gradient(135deg, rgba(139, 0, 255, 0.15) 0%, rgba(139, 0, 255, 0.05) 100%);
    border-left-color: var(--purple);
}

body.dark-mode .big-facts .key-facts-list li {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

body.dark-mode .big-facts .key-facts-list li:hover {
    box-shadow: 0 4px 12px rgba(139, 0, 255, 0.3);
}

/* Responsive Transcript Styles */
@media (max-width: 768px) {
    .transcript {
        padding: 1rem;
        font-size: 0.9rem;
        max-height: 300px;
    }

    .section-header-with-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header-with-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .big-facts-section {
        padding: 1.5rem;
    }

    .big-facts-header {
        font-size: 1.5rem;
    }

    .big-facts .key-facts-list li {
        font-size: 1rem;
        padding: 1rem 1rem 1rem 2.5rem;
    }

    .big-facts .key-facts-list li:before {
        left: 0.75rem;
        font-size: 1.1rem;
    }
}

/* ========== UX IMPROVEMENTS ========== */

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: 1.5rem;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 0.5rem;
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

/* Watched Badge */
.card {
    position: relative;
}

.watched-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 200, 0, 0.95);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.watched-badge::before {
    content: '✓';
    font-size: 0.85rem;
}

/* Bookmark Button */
.card-actions {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.card:hover .card-actions {
    opacity: 1;
}

.bookmark-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bookmark-btn:hover {
    transform: scale(1.1);
    background: var(--purple);
    color: white;
}

.bookmark-btn.bookmarked {
    background: var(--purple);
    color: white;
}

/* Search Result Count */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 2rem;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.search-result-count {
    font-size: 1rem;
    color: var(--gray);
    font-weight: 500;
}

.search-result-count strong {
    color: var(--purple);
    font-weight: 600;
}

/* Search Term Highlight */
.search-highlight {
    background: rgba(139, 0, 255, 0.2);
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    padding: 0 2rem;
}

.pagination-btn {
    padding: 0.75rem 1.25rem;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--black);
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

.pagination-info {
    padding: 0.5rem 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Loading Progress Bar */
.loading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--light-gray);
    z-index: 9999;
}

.loading-progress-bar {
    height: 100%;
    background: var(--purple);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--purple-glow);
}

/* Filter Chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 2rem;
    max-width: var(--max-width);
    margin: 0 auto 2rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--purple-light);
    color: var(--purple);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-chip-remove {
    background: none;
    border: none;
    color: var(--purple);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.filter-chip-remove:hover {
    transform: scale(1.2);
}

.clear-filters-btn {
    background: none;
    border: 1px solid var(--purple);
    color: var(--purple);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-filters-btn:hover {
    background: var(--purple);
    color: white;
}

/* Bookmarks Section */
.bookmarks-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--purple-light);
    color: var(--purple);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.bookmarks-toggle:hover {
    background: var(--purple);
    color: white;
}

.bookmarks-toggle .count {
    background: var(--purple);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.bookmarks-toggle:hover .count {
    background: white;
    color: var(--purple);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--black);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #00a651;
}

.toast.error {
    background: #ff4444;
}

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

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    margin-left: 1rem;
    padding: 0;
}

/* Dark Mode Adjustments for New Features */
body.dark-mode .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

body.dark-mode .skeleton-image {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

body.dark-mode .skeleton-card {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

body.dark-mode .bookmark-btn {
    background: rgba(26, 26, 26, 0.95);
    color: white;
}

body.dark-mode .search-result-count {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .active-filters {
        padding: 0 1rem;
    }

    .watched-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .bookmark-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
}

/* ========== V3 FEATURES ========== */

/* Hover Preview Card */
.card-hover-preview {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.card:hover .card-hover-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.card-hover-preview h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--black);
}

.card-hover-preview p {
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-hover-preview-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.card-hover-preview-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Collections Modal */
.collections-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.collections-modal.active {
    opacity: 1;
    visibility: visible;
}

.collections-modal-content {
    background: var(--white);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.collections-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--black);
}

.collections-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.collections-modal-close:hover {
    background: var(--light-gray);
    color: var(--black);
}

.collections-modal-body {
    padding: 1.5rem;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: var(--light-gray);
    cursor: pointer;
    transition: all 0.3s;
}

.collection-item:hover {
    background: var(--purple-light);
    transform: translateX(5px);
}

.collection-item-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: 8px;
}

.collection-item-info {
    flex: 1;
}

.collection-item-name {
    font-weight: 600;
    color: var(--black);
    margin-bottom: 0.25rem;
}

.collection-item-count {
    font-size: 0.85rem;
    color: var(--gray);
}

.collection-item-actions {
    display: flex;
    gap: 0.5rem;
}

.collection-action-btn {
    background: var(--white);
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.collection-action-btn:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

.create-collection-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.create-collection-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.create-collection-input:focus {
    outline: none;
    border-color: var(--purple);
}

.create-collection-btn {
    background: var(--purple);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.create-collection-btn:hover {
    background: #7000dd;
    transform: translateY(-2px);
}

/* Stats Dashboard */
.stats-dashboard {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats-dashboard h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--black);
}

.stats-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-enhanced {
    background: linear-gradient(135deg, var(--purple-light) 0%, var(--light-gray) 100%);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--purple);
    transition: all 0.3s;
}

.stat-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 0, 255, 0.2);
}

.stat-card-enhanced-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card-enhanced-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 0.25rem;
}

.stat-card-enhanced-label {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.stat-card-enhanced-trend {
    font-size: 0.8rem;
    color: #00a651;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-enhanced-trend.down {
    color: #ff4444;
}

/* Share Bookmark Modal */
.share-bookmark-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.share-bookmark-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-bookmark-content {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.share-bookmark-content h3 {
    margin-bottom: 1rem;
    color: var(--black);
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.share-link-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--purple);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: monospace;
    background: var(--light-gray);
}

.share-link-copy {
    background: var(--purple);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.share-link-copy:hover {
    background: #7000dd;
}

/* Lazy Load Images */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy-loaded {
    opacity: 1;
}

.lazy-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

/* Dark Mode for V3 Features */
body.dark-mode .card-hover-preview {
    background: rgba(26, 26, 26, 0.98);
    box-shadow: 0 -4px 20px rgba(139, 0, 255, 0.3);
}

body.dark-mode .card-hover-preview h4 {
    color: var(--white);
}

body.dark-mode .collections-modal-content {
    background: #1a1a1a;
}

body.dark-mode .collections-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .collection-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .collection-item:hover {
    background: rgba(139, 0, 255, 0.2);
}

body.dark-mode .collection-item-icon {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .stats-dashboard {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .stat-card-enhanced {
    background: linear-gradient(135deg, rgba(139, 0, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
}

body.dark-mode .share-bookmark-content {
    background: #1a1a1a;
}

body.dark-mode .share-link-input {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: var(--purple);
}

body.dark-mode .create-collection-input {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive for V3 */
@media (max-width: 768px) {
    .card-hover-preview {
        display: none; /* Disable hover on mobile */
    }

    .collections-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .stats-grid-enhanced {
        grid-template-columns: 1fr;
    }

    .collection-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .collection-item-actions {
        width: 100%;
        flex-direction: column;
    }

    .collection-action-btn {
        width: 100%;
    }
}

/* ========== ENHANCED MOBILE OPTIMIZATION ========== */

/* Touch-friendly button sizes (44px minimum) */
@media (max-width: 768px) {
    .btn-primary,
    .btn-secondary,
    .btn-gold,
    .btn-submit {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .btn-icon {
        min-width: 48px;
        min-height: 48px;
    }

    .filter-btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

    /* Better touch targets for links */
    .nav-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .footer-section a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Tablet optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header h1 {
        font-size: 2.25rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }
}

/* Small mobile (480px and below) - Enhanced */
@media (max-width: 480px) {
    /* Typography scaling */
    body {
        font-size: 0.9375rem;
    }

    h1, .page-header h1 {
        font-size: 1.625rem;
        line-height: 1.2;
    }

    h2, .section-heading {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Better spacing */
    .page-header {
        padding: 4.5rem 1rem 1.5rem;
    }

    .page-header .subtitle {
        font-size: 0.95rem;
    }

    .page-header .description {
        font-size: 0.95rem;
    }

    /* Cards */
    .card-content {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .card-description {
        font-size: 0.85rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Search & Filters */
    .search-filters {
        padding: 1rem;
    }

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

    .filter-group {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-section h4 {
        margin-bottom: 0.75rem;
    }

    /* Video details */
    .video-title {
        font-size: 1.5rem;
    }

    .video-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .video-meta-item {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .video-meta-item:last-child {
        border-bottom: none;
    }

    /* Transcript */
    .transcript {
        padding: 1rem;
        font-size: 0.875rem;
        max-height: 250px;
    }

    .transcript-collapsible summary {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* Share buttons */
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }

    /* Collections */
    .collection-card {
        padding: 1.5rem;
    }

    .collection-icon {
        font-size: 2rem;
    }

    .collection-card h3 {
        font-size: 1.05rem;
    }

    .collection-card p {
        font-size: 0.85rem;
    }

    /* Big Facts */
    .big-facts-section {
        padding: 1.25rem;
    }

    .big-facts-header {
        font-size: 1.25rem;
    }

    .big-facts .key-facts-list li {
        font-size: 0.9rem;
        padding: 0.875rem 0.875rem 0.875rem 2.25rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 4.5rem 1rem 1rem;
        font-size: 0.85rem;
    }

    /* Major points */
    .major-points {
        padding: 1.25rem;
    }

    .major-points ul {
        margin-left: 1rem;
    }
}

/* Very small mobile (360px and below) - Enhanced */
@media (max-width: 360px) {
    body {
        font-size: 0.875rem;
    }

    h1, .page-header h1 {
        font-size: 1.375rem;
    }

    .logo {
        font-size: 0.95rem;
    }

    .nav-container {
        padding: 0.75rem;
    }

    .page-header {
        padding: 4rem 0.75rem 1rem;
    }

    .grid-container {
        padding: 0.75rem;
    }

    .card-content {
        padding: 0.875rem;
    }

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

    .stat-card {
        padding: 0.875rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-gold {
        width: 100%;
        justify-content: center;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-links {
        padding-top: 3.5rem;
    }

    .nav-links a {
        padding: 0.75rem 0;
        font-size: 0.95rem;
    }

    .page-header {
        padding-top: 4rem;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .nav-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .grid-container,
    .page-header,
    .footer-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .stat-card,
    .collection-card,
    .video-card {
        border-width: 2px;
    }

    .btn-primary,
    .btn-gold {
        border: 2px solid currentColor;
    }
}
