/* --- Global Styles & Variables --- */
:root {
    --primary-text: #1f2937; /* Dark Gray */
    --secondary-text: #6b7280; /* Medium Gray */
    --background-color: #f9fafb; /* Off-white */
    --surface-color: #ffffff; /* Pure White for cards */
    --accent-color: #4f46e5; /* Indigo */
    --border-color: #e5e7eb; /* Light Gray for borders */
    --font-family: 'Inter', 'Noto Sans Thai', 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', sans-serif;
}

/* Basic Reset & Body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--primary-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s; /* Smooth theme transition */
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #3730a3; /* Darker Indigo */
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Shared Component Styles --- */
.page-section {
    padding: 64px 0;
}

.text-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
    color: var(--primary-text);
}

.section-subtitle {
    font-size: 18px;
    color: var(--secondary-text);
    line-height: 1.7;
}

.card-style {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.card-style:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: rgba(249, 250, 251, 0.8); /* Semi-transparent off-white */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.nav-bar {
    transition: all 0.3s ease-in-out;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-text);
}

.nav-logo-icon {
    width: 28px;
    height: 28px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.nav-logo-text {
    font-weight: bold;
    font-size: 20px;
    white-space: nowrap;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Selector */
.lang-selector {
    position: relative;
    z-index: 55;
}

.lang-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-text);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.lang-button:hover {
    color: var(--primary-text);
}

.lang-button svg {
    width: 20px;
    height: 20px;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 140%;
    right: 0;
    min-width: 140px;
    border-radius: 12px;
    padding: 8px;
    overflow: hidden;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
}

.lang-selector.active .lang-dropdown {
    display: block;
}

.lang-option {
    display: block;
    padding: 8px 12px;
    color: var(--primary-text);
    font-size: 16px;
    border-radius: 8px;
    transition: background-color 0.2s;
    color: var(--primary-text);
}

.lang-option:hover {
    background-color: var(--background-color);
}

/* Language-specific fonts for the dropdown */
.lang-option[data-lang="ja"] { font-family: 'Noto Sans JP', sans-serif; }
.lang-option[data-lang="zh-CN"] { font-family: 'Noto Sans SC', sans-serif; }
.lang-option[data-lang="zh-TW"] { font-family: 'Noto Sans TC', sans-serif; }
.lang-option[data-lang="th"] { font-family: 'Noto Sans Thai', sans-serif; }


/* Hamburger Menu */
.hamburger-button {
    width: 24px;
    height: 20px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 70; 
}

.hamburger-button span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--primary-text);
    border-radius: 9px;
    left: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.hamburger-button span.top { top: 0px; }
.hamburger-button span.middle { top: 9px; }
.hamburger-button span.bottom { top: 18px; }

.hamburger-button.active span.top { transform: rotate(45deg); top: 9px; }
.hamburger-button.active span.middle { opacity: 0; }
.hamburger-button.active span.bottom { transform: rotate(-45deg); top: 9px; }

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 60; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.3s;
    background-color: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Close Button for Menu */
.menu-close-button {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 70;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-text);
    transition: color 0.2s, transform 0.2s;
}

.menu-close-button:hover {
    color: var(--primary-text);
    transform: scale(1.1);
}

.menu-close-button svg {
    width: 32px;
    height: 32px;
}

.menu-content {
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    height: 100%;
    padding-top: 64px; 
    padding-bottom: 64px;
}

.menu-scroller {
    width: 100%; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;
}

.main-nav a {
    display: block;
    color: var(--primary-text); 
    font-size: 36px; 
    font-weight: 700;
    padding: 16px 0;
    transition: transform 0.2s, color 0.2s;
}
.main-nav a:hover { color: var(--accent-color); }

.menu-footer {
    flex-shrink: 0; 
    text-align: center;
    padding: 40px 0 0 0;
    color: var(--secondary-text);
}
.menu-footer-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
}

/* --- Home Page --- */
.hero-section {
    padding-top: 128px; 
    padding-bottom: 64px; 
    text-align: center;
}

.hero-title {
    font-size: 3.75rem; /* 60px */
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--primary-text);
}

.hero-subtitle {
    font-size: 1.25rem; /* 20px */
    max-width: 600px;
    margin: 16px auto 0;
    color: var(--secondary-text);
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.app-card {
    display: block;
    color: var(--primary-text);
}

.app-card-content {
    padding: 32px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.app-icon-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* [NEW] Icon style for Inventory Stack */
.inventory-stack-icon {
    background-color: #fefce8; /* Light Yellow */
    color: #713f12; /* Dark Yellow/Brown */
}

/* [NEW] Icon style for Camera Pouch */
.camera-pouch-icon {
    background-color: #f1f5f9; /* Light Gray */
    color: #1e293b; /* Dark Gray/Blue */
}

/* Icon style for Pattern Projects */
.pattern-projects-icon {
    background-color: #ecfdf5; /* Light Green */
    color: #065f46; /* Dark Green */
}

.app-icon-image { width: 100%; height: 100%; display: block; }
.app-card-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.app-card-description { color: var(--secondary-text); }

.app-card-cta {
    margin-top: 24px;
    text-align: right;
}

.cta-button {
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 9999px;
    font-weight: 600;
    transition: background-color 0.2s;
    display: inline-block;
}
.cta-button:hover { background-color: #3730a3; }

/* [NEW] Disabled button style */
.cta-button-disabled {
    background-color: #e5e7eb; /* Light Gray */
    color: #6b7280; /* Medium Gray */
    pointer-events: none; /* Make it unclickable */
    cursor: default;
}

.placeholder-card {
    border: 2px dashed var(--border-color);
    border-radius: 24px;
    padding: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    font-weight: 500;
    font-size: 18px;
}

.commitment-box {
    padding: 32px;
}
.commitment-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 24px;
}
.commitment-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.card-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--accent-color);
}
.commitment-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.commitment-card p { font-size: 16px; color: var(--secondary-text); margin: 0; }

/* --- Footer --- */
.footer {
    padding: 48px 0;
    margin-top: 32px;
    text-align: center;
    color: var(--secondary-text);
    border-top: 1px solid var(--border-color);
}
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

/* --- Spent Today Page --- */
.hero-carousel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 32px;
}
.phone-frame { 
    width: 300px; 
    height: 620px; 
    background-color: var(--surface-color); 
    border-radius: 40px; 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); 
    border: 1px solid var(--border-color);
    padding: 12px; 
    position: relative; 
    margin-bottom: 32px; 
}
.phone-screen { 
    background-color: #000; 
    height: 100%; 
    width: 100%; 
    border-radius: 28px; 
    overflow: hidden; 
    position: relative; 
}
.carousel-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-slide { flex: 0 0 100%; height: 100%; }
.app-screenshot { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; }
.carousel-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    transition: background-color 0.2s; 
    background-color: var(--border-color); 
    border: none; 
    cursor: pointer; 
}
.carousel-dot.active { background-color: var(--primary-text); }
.app-store-button {
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 32px;
    font-size: 18px;
    border-radius: 9999px;
    font-weight: 600;
    transition: background-color 0.2s;
}
.app-store-button:hover { background-color: #3730a3; }

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}
.feature-item h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }

.faq-section {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.faq-content { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 24px; }
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { font-weight: 600; font-size: 18px; margin-bottom: 4px; }
.faq-item p { color: var(--secondary-text); }

/* [NEW] Feature Showcase for App Pages */
.feature-showcase {
    display: grid;
    grid-template-columns: 1fr; /* Mobile-first: single column */
    align-items: center;
    overflow: hidden; /* To keep rounded corners on image */
    padding: 0;
}

.feature-showcase-text {
    padding: 32px;
}

.feature-showcase-text h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-text);
}

.feature-showcase-text p {
    color: var(--secondary-text);
    margin-bottom: 24px;
}

.feature-showcase-text p:last-child {
    margin-bottom: 0;
}

.feature-showcase-image-wrapper {
    background-color: var(--background-color); /* Subtle bg for image */
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.feature-showcase-image {
    width: 100%;
    max-width: 300px; /* Control max size */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Responsive Design --- */
@media (min-width: 640px) {
    .footer-content { flex-direction: row; justify-content: center; gap: 16px; }
    .footer-separator { display: inline; }
    .commitment-card-grid { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-title { font-size: 4.5rem; }
}
@media (min-width: 768px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }

    /* [NEW] Feature showcase for desktop */
    .feature-showcase {
        grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
        padding: 0; /* Card has its own padding */
    }

    /* [NEW] Put image on the right for the first showcase */
    .feature-showcase-image-wrapper {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    .feature-showcase-text {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        padding: 48px;
    }
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-text: #f9fafb;     /* Light Gray / Off-white */
        --secondary-text: #9ca3af;   /* Lighter Gray */
        --background-color: #111827; /* Dark Blue-Gray */
        --surface-color: #1f2937;    /* Lighter Blue-Gray for cards */
        --border-color: #374151;     /* Darker Gray for borders */
        --accent-color: #6366f1;     /* A slightly lighter Indigo for better contrast */
    }

    .header, .menu-overlay {
        background-color: rgba(17, 24, 39, 0.8); /* Dark, translucent background */
    }

    .card-style:hover {
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2), 0 4px 6px -2px rgba(0,0,0,0.1);
    }

    a:hover {
        color: #4338ca; /* Darker Indigo for hover on dark bg */
    }

    .app-store-button:hover, .cta-button:hover {
        background-color: #4338ca;
    }

    .phone-screen {
        /* In dark mode, a dark gray screen looks better than pure black */
        background-color: #111827;
    }

    /* [NEW] Dark mode for disabled button and icon */
    .cta-button-disabled {
        background-color: #374151;
        color: #9ca3af;
    }
    .pattern-projects-icon {
        background-color: #064e3b; /* Darker Green */
        color: #a7f3d0; /* Lighter Green */
    }

    /* [NEW] Dark mode for new icons */
    .inventory-stack-icon {
        background-color: #422006; /* Dark Brown */
        color: #fef08a; /* Light Yellow */
    }
    .camera-pouch-icon {
        background-color: #334155; /* Dark Gray/Blue */
        color: #e2e8f0; /* Light Gray */
    }

    /* [NEW] Dark mode for feature showcase */
    .feature-showcase-image-wrapper {
        background-color: #111827; /* Darker bg */
    }
    .feature-showcase-image {
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    }
}