/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme - Soft Pastel Beach Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f4f0;
    --bg-tertiary: #ede4dc;
    --text-primary: #4a5568;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    --accent: #9dc4d4;
    --accent-hover: #7eb0c4;
    --accent-light: #d4e8f0;
    --accent-peach: #f4c4b4;
    --accent-peach-hover: #e8a894;
    --accent-pink: #f8d4d8;
    --accent-coral: #ec9c94;
    --border: #e2d8cc;
    --border-light: #f0e8dc;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 3px 0 rgba(74, 85, 104, 0.1), 0 1px 2px 0 rgba(74, 85, 104, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(74, 85, 104, 0.1), 0 2px 4px -1px rgba(74, 85, 104, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(74, 85, 104, 0.1), 0 4px 6px -2px rgba(74, 85, 104, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(74, 85, 104, 0.1), 0 10px 10px -5px rgba(74, 85, 104, 0.04);
}

[data-theme="dark"] {
    /* Dark Theme - Muted Pastel Palette */
    --bg-primary: #2d3748;
    --bg-secondary: #374151;
    --bg-tertiary: #4b5563;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-tertiary: #cbd5e0;
    --accent: #9dc4d4;
    --accent-hover: #b8d8e4;
    --accent-light: #2d4f5f;
    --accent-peach: #f4c4b4;
    --accent-peach-hover: #f8d0c4;
    --accent-pink: #f8d4d8;
    --accent-coral: #ec9c94;
    --border: #4b5563;
    --border-light: #5a6478;
    --card-bg: #374151;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header - Clean & Professional */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] header {
    background-color: rgba(30, 41, 59, 0.95);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -0.025em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--accent);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a:focus,
#theme-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    z-index: 101;
    transition: opacity 0.2s ease;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#theme-toggle:hover {
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .icon-light {
    display: none;
}

[data-theme="light"] .icon-dark,
.icon-dark {
    display: none;
}

[data-theme="dark"] .icon-dark {
    display: inline;
}

/* Badge Theme Switching */
.badge-dark {
    display: none;
}

[data-theme="dark"] .badge-light {
    display: none;
}

[data-theme="dark"] .badge-dark {
    display: inline;
}

/* Ensure consistent badge heights */
.app-links img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

/* Hero Section - Light Blue Gradient */
.hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 25%, #7dd3fc 50%, #38bdf8 75%, #0ea5e9 100%);
    color: #1e3a5f;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 40%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 30%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Hero Split Layout */
.hero-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    max-width: 1100px;
}

.hero-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-stats {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.hero-right {
    flex: 0 0 55%;
}

/* Carousel */
.carousel {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .carousel {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.carousel-slides {
    position: relative;
    min-height: 200px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.carousel-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
}

.carousel-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 0.5rem 0;
}

[data-theme="dark"] .carousel-name {
    color: #f7fafc;
}

.carousel-desc {
    font-size: 1rem;
    color: #1e3a5f;
    opacity: 0.85;
    max-width: 300px;
    margin: 0;
    line-height: 1.5;
}

[data-theme="dark"] .carousel-desc {
    color: #e2e8f0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1e3a5f;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.carousel-dot:hover {
    background: rgba(30, 58, 95, 0.3);
}

.carousel-dot.active {
    background: #1e3a5f;
}

[data-theme="dark"] .carousel-dot {
    border-color: #f7fafc;
}

[data-theme="dark"] .carousel-dot:hover {
    background: rgba(247, 250, 252, 0.3);
}

[data-theme="dark"] .carousel-dot.active {
    background: #f7fafc;
}

/* App card highlight animation */
.app-card.highlight {
    animation: card-pulse 1s ease-out;
}

@keyframes card-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(157, 196, 212, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(157, 196, 212, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(157, 196, 212, 0);
    }
}

/* Patreon Button */
@keyframes patreon-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 66, 77, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 66, 77, 0.5);
    }
}

.patreon-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 66, 77, 0.4);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    animation: patreon-glow 2.5s ease-in-out infinite;
}

.patreon-btn:hover {
    background: #ffffff;
    border-color: #FF424D;
    transform: translateY(-3px);
    animation: none;
    box-shadow: 0 8px 30px rgba(255, 66, 77, 0.4);
}

.patreon-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3a5f;
}

.patreon-logo {
    height: 28px;
    width: 148px;
    object-fit: contain;
    object-position: left center;
}

[data-theme="dark"] .patreon-btn {
    background: rgba(45, 55, 72, 0.95);
    border-color: rgba(255, 66, 77, 0.5);
}

[data-theme="dark"] .patreon-btn:hover {
    background: #374151;
    border-color: #FF424D;
}

[data-theme="dark"] .patreon-text {
    color: #f7fafc;
}

/* Content Sections - Clean Layout */
.content-section {
    padding: 1.75rem 0;
}

.alt-bg {
    background-color: var(--bg-secondary);
}

.content-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.content-section h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 0.875rem;
    font-size: 1.125rem;
    line-height: 1.7;
}

.content-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* App Grid Layout */
#apps {
    background-color: var(--bg-primary);
}

/* Category Colors */
:root {
    --cat-highlights: #f59e0b;
    --cat-games: #ef4444;
    --cat-tabletop: #3b82f6;
    --cat-tools: #22c55e;
    --cat-lifestyle: #a855f7;
    --cat-productivity: #f97316;
    --cat-coming-soon: #6b7280;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.filter-chip.active .chip-dot {
    background: white;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chip-dot.highlights { background: var(--cat-highlights); }
.chip-dot.games { background: var(--cat-games); }
.chip-dot.tabletop { background: var(--cat-tabletop); }
.chip-dot.tools { background: var(--cat-tools); }
.chip-dot.lifestyle { background: var(--cat-lifestyle); }
.chip-dot.productivity { background: var(--cat-productivity); }
.chip-dot.coming-soon { background: var(--cat-coming-soon); }

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Hidden state for filtering */
.app-card.hidden {
    display: none;
}

/* Category accent on cards */
.app-card {
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 16px 0 0 16px;
}

.app-card[data-category="highlights"]::before { background: var(--cat-highlights); }
.app-card[data-category="games"]::before { background: var(--cat-games); }
.app-card[data-category="tabletop"]::before { background: var(--cat-tabletop); }
.app-card[data-category="tools"]::before { background: var(--cat-tools); }
.app-card[data-category="lifestyle"]::before { background: var(--cat-lifestyle); }
.app-card[data-category="productivity"]::before { background: var(--cat-productivity); }

/* App Cards - Compact Grid Design */
.app-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.app-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    background: #1D1D1F;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.app-card h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.app-tagline {
    margin-bottom: 16px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.app-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.app-badges img {
    height: 32px;
    width: auto;
}

.coming-soon {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Placeholder card styling */
.placeholder-card {
    border-style: dashed;
    opacity: 0.7;
}

.placeholder-icon {
    background: var(--bg-secondary) !important;
    box-shadow: none !important;
}

.placeholder-icon span {
    font-size: 2rem;
    color: var(--text-tertiary);
    font-weight: 300;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 1.75rem;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    border: none;
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--accent-peach);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--accent-peach-hover);
}

/* Legal Section */
.legal-links {
    list-style: none;
    margin-left: 0;
}

.legal-links li {
    margin-bottom: 1rem;
}

.legal-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-links a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Footer - Minimal & Clean */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
    color: var(--text-tertiary);
}

footer p {
    font-size: 0.9375rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
    }

    #theme-toggle {
        order: 1;
    }

    header .container {
        flex-wrap: wrap;
    }

    nav {
        order: 3;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.2s ease;
        opacity: 0;
    }

    nav.open {
        max-height: 300px;
        opacity: 1;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        padding: 0.5rem 0;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }

    nav li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 0.875rem 0;
        font-size: 1rem;
    }

    nav a::after {
        display: none;
    }

    /* Overlay not needed for dropdown style */
    .mobile-overlay {
        display: none !important;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero-split {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .hero-left {
        flex: none;
        width: 100%;
        align-items: center;
    }

    .hero-stats {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .hero-right {
        flex: none;
        width: 100%;
    }

    .carousel {
        padding: 1.5rem;
    }

    .carousel-slides {
        min-height: 180px;
    }

    .carousel-icon {
        width: 80px;
        height: 80px;
        border-radius: 18px;
    }

    .carousel-name {
        font-size: 1.25rem;
    }

    .carousel-desc {
        font-size: 0.9rem;
    }

    .carousel-dots {
        margin-top: 1rem;
    }

    .patreon-btn {
        padding: 14px 24px;
        gap: 10px;
        margin-top: 1.5rem;
    }

    .patreon-text {
        font-size: 1rem;
    }

    .patreon-logo {
        height: 24px;
        width: 127px;
    }

    .content-section {
        padding: 3.5rem 0;
    }

    .content-section h2 {
        font-size: 1.875rem;
        margin-bottom: 1.5rem;
    }

    .content-section p,
    .content-section li {
        font-size: 1.0625rem;
    }

    /* App grid - 2 columns on mobile */
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .app-card {
        padding: 16px 12px;
    }

    .app-icon {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .app-icon img {
        border-radius: 12px;
    }

    .app-card h4 {
        font-size: 0.9375rem;
    }

    .app-tagline {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .app-badges img {
        height: 28px;
    }

    .filter-chips {
        gap: 6px;
        margin-bottom: 16px;
    }

    .filter-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .chip-dot {
        width: 6px;
        height: 6px;
    }

    .btn {
        height: 40px;
        padding: 0 1.5rem;
        font-size: 0.9rem;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .hero h2 {
        font-size: 3rem;
    }

    .content-section h2 {
        font-size: 2.25rem;
    }

    .app-card {
        padding: 2.25rem;
    }
}

/* App List Table */
.app-list {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.app-list th,
.app-list td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.app-list th {
    font-weight: 600;
}

/* Print styles */
@media print {
    header {
        position: static;
    }

    nav, #theme-toggle, .mobile-menu-toggle {
        display: none;
    }

    .hero {
        background: linear-gradient(135deg, #e0f2fe 0%, #7dd3fc 50%, #0ea5e9 100%);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .app-card {
        page-break-inside: avoid;
    }
}
