:root {
    --background: #ffffff;
    --foreground: #0f172a;
    --muted: #f8fafc;
    --muted-foreground: #64748b;
    --popover: #ffffff;
    --popover-foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --border: #e2e8f0;
    --input: #e2e8f0;
    --primary: #0f172a;
    --primary-foreground: #f8fafc;
    --secondary: #f1f5f9;
    --secondary-foreground: #0f172a;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --destructive-foreground: #f8fafc;
    --ring: #94a3b8;
    --radius: 0.75rem;
}

.dark {
    --background: #000000;
    --foreground: #f8fafc;
    --muted: #1e293b;
    --muted-foreground: #a1a1aa;
    --popover: #000000;
    --popover-foreground: #f8fafc;
    --card: #000000;
    --card-foreground: #f8fafc;
    --border: #1e293b;
    --input: #1e293b;
    --primary: #f8fafc;
    --primary-foreground: #000000;
    --secondary: #1e293b;
    --secondary-foreground: #f8fafc;
    --accent: #1e293b;
    --accent-foreground: #f8fafc;
    --destructive: #7f1d1d;
    --destructive-foreground: #f8fafc;
    --ring: #334155;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--background);
    color: var(--foreground);
}

#root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.flex-1 {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Layout Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-10 {
    gap: 2.5rem;
}

.grid {
    display: grid;
}

.place-items-center {
    place-items: center;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:flex {
        display: flex;
    }

    .md\:py-20 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Components */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.button:hover {
    opacity: 0.9;
}

.button-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.button-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 1rem;
}

.button-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.card {
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    background-color: var(--background);
}

.input {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--input);
    background-color: var(--background);
    color: var(--foreground);
    font-size: 0.875rem;
    outline: none;
}

.input:focus {
    border-color: var(--ring);
}

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

/* Specific Styles */
/* Mobile Menu Styles */
#mobileMenu {
    position: fixed;
    top: 4rem;
    /* Height of header */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding: 1rem;
    overflow-y: auto;
    animation: slideDown 0.2s ease-out;
}

/* Ensure navbar is always on top */
.sticky-nav {
    z-index: 40;
    position: sticky;
    top: 0;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

/* Dark Mode Fixes */
.dark .button-outline {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark #mobileMenu {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
}

.top-bar {
    display: flex;
    height: 4rem;
    align-items: center;
    justify-content: space-between;
}

.hero {
    padding: 3.5rem 0;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--muted-foreground);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.icon-box {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--foreground);
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.pl-9 {
    padding-left: 2.25rem;
}

.episode-item {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.episode-item:hover {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

textarea {
    width: 100%;
    min-height: 140px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    font-family: inherit;
    font-size: 0.875rem;
    resize: none;
}

.top-bar {
    display: flex;
    height: 4rem;
    align-items: center;
    justify-content: space-between;
}

.hero {
    padding: 3.5rem 0;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--muted-foreground);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.icon-box {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--foreground);
}

.nav-link.active {
    color: var(--foreground);
    font-weight: 500;
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--muted-foreground);
}

.pl-9 {
    padding-left: 2.25rem;
}

.episode-item {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    transition: box-shadow 0.2s;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.episode-item:hover {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

textarea {
    width: 100%;
    min-height: 140px;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.875rem;
    resize: none;
}

footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
}

.hidden {
    display: none;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:flex {
        display: flex;
    }

    .md\:hidden {
        display: none;
    }

    .md\:py-20 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Horizontal Scroll */
.overflow-x-auto {
    overflow-x: auto;
}

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

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Menu Styles */


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-fade-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.05s;
}

/* Responsive utilities for Support Link */
@media (min-width: 1024px) {
    .lg\:flex {
        display: flex;
    }

    .lg\:hidden {
        display: none;
    }
}

/* Theme-aware Logo Switching */
.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

.dark .logo-light {
    display: none;
}

.dark .logo-dark {
    display: block;
}