:root {
    /* Default (Dark) */
    --primary: #6C63FF;
    --primary-glow: rgba(108, 99, 255, 0.5);
    --secondary: #00D2FF;

    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-glass: rgba(15, 23, 42, 0.8);
    --bg-modal: #1e293b;
    /* Solid dark for modal */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-light: rgba(255, 255, 255, 0.1);

    --success: #10b981;
    --danger: #ef4444;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 15px var(--primary-glow);
}

[data-theme="light"] {
    --bg-main: #f0f9ff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-modal: #ffffff;
    /* Solid white for modal */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-light: rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(108, 99, 255, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(108, 99, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 210, 255, 0.15) 0%, transparent 40%);
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

/* Dynamic Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orb-float 20s infinite ease-in-out;
}

/* Radar-inspired hero background */
.radar-wrapper {
    position: absolute;
    top: 45%;
    left: 50%;
    width: min(75vw, 520px);
    height: min(75vw, 520px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.55) 0%, rgba(0, 210, 255, 0.25) 40%, rgba(15, 23, 42, 0) 70%);
    border: 2px solid rgba(108, 99, 255, 0.45);
    box-shadow:
        0 0 50px rgba(108, 99, 255, 0.45),
        0 0 120px rgba(0, 210, 255, 0.35);
    overflow: hidden;
    mix-blend-mode: screen;
    pointer-events: none;
}

.radar-wrapper::after {
    content: '';
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.25), transparent 60%);
    filter: blur(30px);
    animation: glowPulse 6.5s ease-in-out infinite;
}

.radar-ring {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    animation: ringPulse 10s infinite;
}

.radar-ring.ring-2 {
    inset: 24%;
    animation-delay: 1.5s;
}

.radar-ring.ring-3 {
    inset: 36%;
    animation-delay: 3s;
}

.radar-sweep {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    animation: sweepRotate 11s linear infinite, sweepGlow 3s ease-in-out infinite;
    mix-blend-mode: screen;
    filter: drop-shadow(0 0 20px rgba(0, 210, 255, 0.7));
}

.radar-pulse {
    position: absolute;
    inset: -10%;
    border-radius: 50%;
    border: 2px solid rgba(108, 99, 255, 0.45);
    animation: pulseExpand 5.5s ease-out infinite;
    box-shadow: 0 0 25px rgba(108, 99, 255, 0.45);
}

.radar-pulse.pulse-2 {
    animation-delay: 2.2s;
}

.radar-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.6rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.7),
        0 0 22px rgba(108, 99, 255, 0.6);
    animation: textPulse 4.5s ease-in-out infinite;
}

.radar-center-text span {
    display: block;
    line-height: 1.6;
    font-size: 0.85rem;
    letter-spacing: 0.4rem;
}

[data-theme="light"] .radar-wrapper {
    mix-blend-mode: normal;
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .radar-center-text {
    color: rgba(15, 23, 42, 0.5);
}

.radar-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.radar-dots span {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #00d2ff 0%, rgba(0, 210, 255, 0) 70%);
    box-shadow:
        0 0 12px rgba(0, 210, 255, 0.9),
        0 0 25px rgba(108, 99, 255, 0.6);
    top: var(--y);
    left: var(--x);
    animation: dotBlink 4s infinite;
    animation-delay: var(--delay);
}

@keyframes ringPulse {
    0% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.2;
    }
}

@keyframes sweepRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes sweepGlow {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

@keyframes pulseExpand {
    0% {
        transform: scale(0.5);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes dotBlink {

    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.75);
    }

    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.95);
    }

    50% {
        opacity: 0.75;
        transform: scale(1.05);
    }
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.65;
        letter-spacing: 0.5rem;
    }

    50% {
        opacity: 1;
        letter-spacing: 0.7rem;
    }
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--primary);
    animation-delay: 0s;
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--secondary);
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: #8b5cf6;
    /* Violet */
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes orb-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.floating-pin {
    position: absolute;
    color: var(--text-muted);
    /* More subtle color */
    opacity: 0.15;
    /* Subtle opacity */
    font-size: 2.5rem;
    /* Smaller icons */
    animation: float 15s infinite ease-in-out;
    /* Slower float */
}

.p1 {
    top: 15%;
    left: 8%;
    animation-duration: 18s;
}

.p2 {
    top: 65%;
    right: 10%;
    animation-duration: 22s;
    animation-delay: 2s;
}

.p3 {
    bottom: 15%;
    left: 25%;
    animation-duration: 25s;
    animation-delay: 5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.hidden {
    display: none !important;
}

/* Enhanced Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
    transition: transform 0.3s ease;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo:hover .logo-icon {
    transform: scale(1.1) rotate(-10deg);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
}

/* The original .logo and .logo-icon styles are replaced by the "Enhanced Logo" section above */
/*
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.logo-icon {
    color: var(--primary);
    font-size: 1.5rem;
}
*/

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: var(--spacing-xs);
    transition: transform 0.2s;
}

.icon-btn:active {
    transform: scale(0.95);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-weight: bold;
}

/* Main Content */
.app-main {
    padding: var(--spacing-lg);
    max-width: 1000px;
    /* Increased from 600px for better desktop view */
    margin: 0 auto;
    padding-bottom: 80px;
    /* Space for chatbot fab */
}

/* Hero Section */
/* Enhanced Hero */
.hero {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-top: var(--spacing-xl);
    /* Add top padding for vertical rhythm */
}

.tagline {
    font-size: 3rem;
    /* Larger tagline */
    font-weight: 800;
    margin-bottom: var(--spacing-xl);
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    letter-spacing: -1px;
}

[data-theme="light"] .tagline {
    background: linear-gradient(to right, #1e293b, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Larger & Smoother Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 cols mobile */
    gap: var(--spacing-md);
    /* Smaller gap for 3 cols */
}

@media (max-width: 480px) {
    .tagline {
        font-size: 2rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols mobile */
        gap: var(--spacing-sm);
    }

    .cat-btn {
        padding: var(--spacing-md);
        min-height: 110px;
    }

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

    .cat-btn span {
        font-size: 0.9rem;
    }
}

@media (min-width: 600px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols tablet */
    }
}

@media (min-width: 900px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        /* 4 cols desktop */
    }
}

.cat-btn {
    background: linear-gradient(155deg, rgba(24, 34, 74, 0.95), rgba(54, 17, 88, 0.7));
    border: 1px solid rgba(141, 98, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--text-muted);
    min-height: 140px;
    /* Taller blocks */
    position: relative;
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(14, 16, 36, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .cat-btn {
    background: linear-gradient(155deg, rgba(247, 250, 255, 0.95), rgba(214, 237, 255, 0.85));
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow:
        0 18px 30px rgba(148, 163, 184, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.cat-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s ease;
    z-index: 0;
    transform: scale(0.6);
}

[data-theme="light"] .cat-btn::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), rgba(148, 163, 184, 0));
}

.cat-btn::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 255, 255, 0.25) 90deg, transparent 160deg);
    animation: cardSweep 8s linear infinite;
    opacity: 0.35;
}

.cat-btn:hover,
.cat-btn:active {
    transform: translateY(-5px) scale(1.02);
    border-color: transparent;
    box-shadow: 0 10px 30px -10px var(--primary-glow);
    color: white;
}

.cat-btn:hover::before {
    opacity: 0.25;
    transform: scale(1);
}

.cat-icon {
    font-size: 3rem;
    color: #87f9ff;
    z-index: 1;
    transition: transform 0.4s ease, filter 0.3s ease;
    animation: iconPulse 6s ease-in-out infinite;
}

[data-theme="light"] .cat-icon {
    color: #2b4a7a;
    text-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.cat-btn:hover .cat-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 8px 20px rgba(0, 210, 255, 0.35));
}

.cat-btn span {
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 1;
}

.categories-grid .cat-btn:nth-child(1) .cat-icon {
    animation-delay: 0s;
}

.categories-grid .cat-btn:nth-child(2) .cat-icon {
    animation-delay: 0.2s;
}

.categories-grid .cat-btn:nth-child(3) .cat-icon {
    animation-delay: 0.4s;
}

.categories-grid .cat-btn:nth-child(4) .cat-icon {
    animation-delay: 0.6s;
}

.categories-grid .cat-btn:nth-child(5) .cat-icon {
    animation-delay: 0.8s;
}

.categories-grid .cat-btn:nth-child(6) .cat-icon {
    animation-delay: 1s;
}

.categories-grid .cat-btn:nth-child(7) .cat-icon {
    animation-delay: 1.2s;
}

.categories-grid .cat-btn:nth-child(8) .cat-icon {
    animation-delay: 1.4s;
}

.categories-grid .cat-btn:nth-child(9) .cat-icon {
    animation-delay: 1.6s;
}

.categories-grid .cat-btn:nth-child(10) .cat-icon {
    animation-delay: 1.8s;
}

.categories-grid .cat-btn:nth-child(11) .cat-icon {
    animation-delay: 2s;
}

.categories-grid .cat-btn:nth-child(12) .cat-icon {
    animation-delay: 2.2s;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
    }

    50% {
        transform: translateY(-6px) scale(1.05);
        filter: drop-shadow(0 8px 18px rgba(108, 99, 255, 0.35));
    }
}

@keyframes cardSweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Search Section */
.search-section {
    margin-bottom: var(--spacing-xl);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Enhanced Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: var(--spacing-md) var(--spacing-xl);
    /* Larger padding */
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.01);
}

.search-icon {
    color: var(--text-muted);
    margin-right: var(--spacing-md);
    font-size: 1.2rem;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    padding: var(--spacing-xs) 0;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.voice-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: var(--spacing-xs);
}

/* Results Section */
.results.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 1rem;
}

.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Responsive grid for results */
    gap: var(--spacing-lg);
}

/* Enhanced Result Cards */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    /* Equal height */
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.card-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    flex-grow: 1;
    /* Push actions to bottom */
}

.card-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.grid-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.action-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 8px 16px;
    /* Larger touch target */
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    text-decoration: none;
}

.action-chip:hover {
    background: rgba(255, 255, 255, 0.1);
}

.action-chip.primary {
    background: var(--primary);
    border-color: var(--primary);
}

/* Chatbot FAB */
.fab-chatbot {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    width: 64px;
    /* Larger FAB */
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: white;
    font-size: 1.8rem;
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.fab-chatbot:hover {
    transform: scale(1.1);
}

/* Modals */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 190;
    opacity: 1;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: var(--bg-modal);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    z-index: 200;
    box-shadow: var(--shadow-md);
    animation: zoomIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

.modal.bottom-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slideUpSheet 0.3s ease-out;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.modal-body {
    padding: var(--spacing-lg);
    max-height: 70vh;
    overflow-y: auto;
}

/* Preview Modal Specifics */
.preview-tabs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding-bottom: var(--spacing-xs);
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    font-size: 1rem;
}

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

.preview-pane {
    display: none;
    height: 300px;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.preview-pane.active {
    display: block;
}

.preview-pane iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.placeholder-video {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.action-btn {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 1rem;
}

.action-btn.primary {
    background: var(--primary);
    color: white;
    grid-column: span 2;
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

/* Chatbot Specifics */
.chat-messages {
    height: 300px;
    /* Taller chat area */
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.message {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    max-width: 80%;
    font-size: 1rem;
    line-height: 1.4;
}

.message.bot {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

[data-theme="light"] .message.bot {
    background: #e2e8f0;
    /* Darker grey for light mode bot message */
}

/* Typing Indicator */
.typing-indicator span {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 1px;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.chip {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Saved Items */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.saved-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.saved-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

.saved-info {
    flex: 1;
}

.saved-keyword {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.saved-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.saved-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-icon-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: color 0.2s;
}

.btn-icon-sm:hover {
    color: var(--primary);
}

.btn-icon-sm.delete:hover {
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
    .tagline {
        font-size: 2rem;
    }

    .app-main {
        padding: var(--spacing-md);
    }

    .categories-grid {
        gap: var(--spacing-md);
    }

    .cat-btn {
        min-height: 120px;
        padding: var(--spacing-md);
    }

    .cat-icon {
        font-size: 2.2rem;
    }
}

/* Exit Modal Styles */
.exit-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.exit-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.exit-icon-anim {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 28px;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), rgba(99, 102, 241, 0.35));
    box-shadow:
        0 25px 40px rgba(15, 23, 42, 0.35),
        inset 0 0 35px rgba(99, 102, 241, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: exitFloat 7s ease-in-out infinite;
    overflow: hidden;
}

.exit-icon-ring {
    position: absolute;
    inset: 10px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    animation: exitRing 5s linear infinite;
    pointer-events: none;
}

.exit-icon-anim i {
    font-size: 2.5rem;
    color: #a5b4fc;
    text-shadow:
        0 10px 25px rgba(79, 70, 229, 0.6),
        0 0 15px rgba(129, 140, 248, 0.8);
}

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

.exit-text-subtitle {
    color: var(--text-muted);
    line-height: 1.5;
}

.exit-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.exit-progress {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.exit-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #a78bfa, #38bdf8);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.exit-progress-fill.active {
    animation: exitCountdown var(--exit-duration, 4000ms) linear forwards;
}

.exit-progress-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.exit-input .form-input {
    width: 100%;
    margin: 0;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* Select Styling */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z' fill='rgba(255,255,255,0.5)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px !important;
}

[data-theme="light"] select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z' fill='rgba(0,0,0,0.5)'/%3E%3C/svg%3E");
}

.exit-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.exit-actions .action-btn {
    width: 100%;
}

.exit-actions .action-btn.secondary {
    background: rgba(148, 163, 184, 0.15);
}

@media (min-width: 520px) {
    .exit-actions {
        flex-direction: row;
    }

    .exit-actions .action-btn {
        width: auto;
        flex: 1;
    }
}

[data-theme="light"] .exit-icon-anim {
    background: radial-gradient(circle at 35% 30%, rgba(79, 70, 229, 0.15), rgba(191, 219, 254, 0.6));
    box-shadow:
        0 20px 35px rgba(148, 163, 184, 0.4),
        inset 0 0 30px rgba(129, 140, 248, 0.45);
}

[data-theme="light"] .exit-icon-ring {
    border-color: rgba(79, 70, 229, 0.4);
}

[data-theme="light"] .exit-progress {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .exit-progress-fill {
    background: linear-gradient(90deg, #6366f1, #0ea5e9);
}

[data-theme="light"] .exit-input .form-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.2);
    color: #0f172a;
}

[data-theme="light"] .exit-actions .action-btn.secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #0f172a;
}

@keyframes exitFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes exitRing {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 2D Swipe Layout */
#viewport {
    width: 100vw;
    height: 100vh;
    overflow: scroll;
    scroll-snap-type: both mandatory;
    scroll-behavior: smooth;
    position: relative;
    z-index: 10;
    /* Above background */
}

#world {
    width: 200vw;
    height: 200vh;
    display: grid;
    grid-template-columns: 100vw 100vw;
    grid-template-rows: 100vh 100vh;
}

.screen {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    overflow-y: auto;
    /* Allow internal scrolling */
    position: relative;
    background: transparent;
    /* Let background shine through */
}

#screen-home {
    grid-column: 1;
    grid-row: 1;
}

#screen-chatbot {
    grid-column: 2;
    grid-row: 1;
    background: var(--bg-glass);
    /* Slight background for readability */
    backdrop-filter: blur(20px);
}

#screen-discovery {
    grid-column: 1;
    grid-row: 2;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    background: rgba(15, 23, 42, 0.8);
    position: sticky;
    top: 0;
    z-index: 50;
}

.screen-body {
    padding: var(--spacing-lg);
    min-height: calc(100vh - 80px);
}

/* Hide scrollbars for cleaner look */
#viewport::-webkit-scrollbar {
    display: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

/* Adjustments for new layout */
.app-header {
    position: sticky;
    top: 0;
}

/* Chatbot & Saved specific adjustments */
.chat-messages {
    height: auto;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Remove old modal styles for chatbot/saved if they conflict, 
   but keep generic .modal for Location/Exit */

/* Discovery Screen Styles */
.discovery-section {
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-main);
}

/* Horizontal Scroll for Trending */
.horizontal-scroll {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.discovery-card {
    min-width: 160px;
    width: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border-light);
}

.discovery-card:active {
    transform: scale(0.95);
}

.discovery-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.discovery-card .card-info {
    padding: var(--spacing-sm);
}

.discovery-card .card-info span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collections Grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.collection-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: background 0.2s;
}

.collection-card:active {
    background: rgba(255, 255, 255, 0.1);
}

.collection-card .col-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.collection-card span {
    font-weight: 600;
    color: var(--text-main);
}

/* Platform Hub Styles */
.platform-category {
    margin-bottom: var(--spacing-xl);
}

.category-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.platform-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.platform-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
}

.platform-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.platform-info {
    flex: 1;
}

.platform-name {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.platform-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}