/* ==========================================================================
   팜마켓 브랜드 팔레트 — farmmarket-flutter 앱 테마와 동기화
   - 시드 컬러: #10b981 (에메랄드 그린, lib/theme/app_colors.dart)
   - 라이트 그라데이션: #047857 → #10b981 → #34d399 (brandGradient)
   - 다크 그라데이션:   #064e3b → #065f46 → #047857 (brandGradientDark)
   ========================================================================== */

:root {
    color-scheme: light;

    /* 브랜드 */
    --accent: #10b981;            /* 그래픽/보더용 브랜드색 */
    --accent-ink: #047857;        /* 텍스트/아이콘용 (WCAG AA 대비 확보) */
    --accent-strong: #065f46;     /* hover 등 더 진한 톤 */
    --accent-soft: #34d399;
    --on-accent: #ffffff;         /* accent-ink 배경 위 텍스트 */
    --brand-gradient: linear-gradient(135deg, #047857 0%, #10b981 50%, #34d399 100%);

    /* 배경/서피스 */
    --bg: #ffffff;
    --bg-alt: #f6faf8;
    --surface: #ffffff;
    --surface-raised: #f6faf8;
    --border: #e5e7eb;
    --border-strong: #d1d5db;

    /* 텍스트 */
    --text: #1f2937;
    --text-strong: #111827;
    --text-muted: #5b6572;

    /* 내비게이션 */
    --nav-bg: rgba(255, 255, 255, 0.92);
    --nav-bg-solid: rgba(255, 255, 255, 0.98);
    --nav-shadow: 0 2px 10px rgba(15, 41, 30, 0.08);

    /* 푸터 */
    --footer-bg: #122a21;
    --footer-text: #d1dcd6;
    --footer-muted: #93a59c;
    --footer-border: #29453a;

    /* 강조 박스 (경고/안내) */
    --warn-bg: #fef3c7;
    --warn-border: #f59e0b;
    --warn-text: #92400e;

    /* 그림자 */
    --shadow-sm: 0 1px 3px rgba(15, 41, 30, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 41, 30, 0.08);
    --shadow-lg: 0 12px 28px rgba(15, 41, 30, 0.14);
}

/* 시스템 다크 모드 (수동으로 light를 고르지 않은 경우) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --accent: #34d399;
        --accent-ink: #34d399;
        --accent-strong: #6ee7b7;
        --accent-soft: #10b981;
        --on-accent: #06281d;
        --brand-gradient: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);

        --bg: #0f1613;
        --bg-alt: #131c17;
        --surface: #1a241f;
        --surface-raised: #202c26;
        --border: #2b3a33;
        --border-strong: #3a4d44;

        --text: #e4eae6;
        --text-strong: #f4f7f5;
        --text-muted: #a7b5ae;

        --nav-bg: rgba(15, 22, 19, 0.9);
        --nav-bg-solid: rgba(15, 22, 19, 0.98);
        --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

        --footer-bg: #0b110e;
        --footer-text: #cbd6d0;
        --footer-muted: #8b9a92;
        --footer-border: #23312a;

        --warn-bg: rgba(245, 158, 11, 0.12);
        --warn-border: #d97706;
        --warn-text: #fbbf24;

        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
    }
}

/* 수동 다크 모드 (토글 버튼) — 시스템 설정보다 우선 */
:root[data-theme="dark"] {
    color-scheme: dark;

    --accent: #34d399;
    --accent-ink: #34d399;
    --accent-strong: #6ee7b7;
    --accent-soft: #10b981;
    --on-accent: #06281d;
    --brand-gradient: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);

    --bg: #0f1613;
    --bg-alt: #131c17;
    --surface: #1a241f;
    --surface-raised: #202c26;
    --border: #2b3a33;
    --border-strong: #3a4d44;

    --text: #e4eae6;
    --text-strong: #f4f7f5;
    --text-muted: #a7b5ae;

    --nav-bg: rgba(15, 22, 19, 0.9);
    --nav-bg-solid: rgba(15, 22, 19, 0.98);
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);

    --footer-bg: #0b110e;
    --footer-text: #cbd6d0;
    --footer-muted: #8b9a92;
    --footer-border: #23312a;

    --warn-bg: rgba(245, 158, 11, 0.12);
    --warn-border: #d97706;
    --warn-text: #fbbf24;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    background: var(--nav-bg-solid);
    box-shadow: var(--nav-shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-ink);
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

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

.nav-menu a:hover {
    color: var(--accent-ink);
}

/* 언어 선택 */
#languageSelect {
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

#languageSelect:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* 테마 토글 버튼 */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 1rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent-ink);
    border-color: var(--accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: 0.75rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu.active {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--nav-bg-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--nav-shadow);
    gap: 0;
}

.nav-menu.active li {
    padding: 0.75rem 20px;
    border-bottom: 1px solid var(--border);
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: var(--brand-gradient);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.92;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background: #ffffff;
    color: #047857;
}

.btn-primary:hover {
    background: #ecfdf5;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-secondary:hover {
    background: #ffffff;
    color: #047857;
}

/* Phone Mockup */
.phone-mockup {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-screen {
    width: 280px;
    height: 560px;
    background: #10201a;
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.app-preview {
    background: var(--brand-gradient);
    height: 100%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    color: #ffffff;
}

.preview-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.preview-text {
    text-align: center;
    margin-bottom: 15px;
}

.preview-text h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.preview-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.preview-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 8px;
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--bg-alt);
}

.features h2 {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 3rem;
    color: var(--text-strong);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: #ffffff;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-strong);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Download Section */
.download {
    padding: 80px 0;
    background: var(--bg);
}

.download h2 {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--text-strong);
}

.download > .container > p {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.download-options {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.download-card {
    display: flex;
    align-items: center;
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: var(--surface-raised);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    min-width: 250px;
}

.download-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


.download-card i {
    font-size: 3rem;
    margin-right: 1rem;
    color: var(--accent-ink);
}

.download-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-strong);
}

.download-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* About Section */
.about {
    padding: 80px 0;
    background: var(--bg-alt);
}

.about h2 {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 3rem;
    color: var(--text-strong);
}

.about-content {
    display: flex;
    justify-content: center;
    align-items: start;
}

.about-text {
    max-width: 800px;
    width: 100%;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-strong);
}

.about-text p {
    margin-bottom: 2rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.about-text ul {
    list-style: none;
    margin-bottom: 2rem;
}

.about-text li {
    padding: 0.75rem 0;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: start;
}

.about-text li strong {
    color: var(--text);
}

.about-text li::before {
    content: "✓";
    color: var(--accent-ink);
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2rem;
}

.about-text li:last-child {
    border-bottom: none;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-section p {
    color: var(--footer-text);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--footer-border);
    color: var(--footer-muted);
}

/* Legal Pages */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 40px 20px;
    line-height: 1.8;
}

.privacy-content h1 {
    color: var(--text-strong);
    margin-bottom: 2rem;
    text-align: center;
}

.privacy-content h2 {
    color: var(--text-strong);
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.privacy-content h3 {
    color: var(--text);
    margin: 1.5rem 0 0.5rem 0;
}

.privacy-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.privacy-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.privacy-content li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.privacy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.privacy-content th,
.privacy-content td {
    border: 1px solid var(--border-strong);
    padding: 12px;
    text-align: left;
    color: var(--text-muted);
}

.privacy-content th {
    background: var(--surface-raised);
    font-weight: 600;
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--accent-ink);
    color: var(--on-accent);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: var(--accent-strong);
}

.back-link i {
    margin-right: 0.5rem;
}

.contact-info {
    background: var(--surface-raised);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
}

.contact-info h3 {
    color: var(--text-strong);
    margin-bottom: 1rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info i {
    color: var(--accent-ink);
    margin-right: 0.5rem;
}

.highlight-box {
    background: var(--warn-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--warn-border);
    margin: 1.5rem 0;
}

.highlight-box strong {
    color: var(--warn-text);
}

/* FAQ */
.faq-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 20px 40px 20px;
}

.faq-content h1 {
    color: var(--text-strong);
    margin-bottom: 2rem;
    text-align: center;
}

.faq-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    color: var(--text-strong);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: start;
}

.faq-question i {
    color: var(--accent-ink);
    margin-right: 0.75rem;
    margin-top: 0.25rem;
}

.faq-answer {
    color: var(--text-muted);
    line-height: 1.8;
    padding-left: 2rem;
}

.faq-answer ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--brand-gradient);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* 다크 모드에서 로고/아이콘 이미지에 은은한 테두리 */
:root[data-theme="dark"] .nav-logo img,
:root[data-theme="dark"] .preview-icon img {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nav-logo img,
    :root:not([data-theme="light"]) .preview-icon img {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg-solid);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0;
        box-shadow: var(--nav-shadow);
    }

    .nav-menu li {
        padding: 0.75rem 20px;
        border-bottom: 1px solid var(--border);
    }

    .hamburger {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .about-content {
        flex-direction: column;
    }

    .download-options {
        flex-direction: column;
        align-items: center;
    }

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

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .phone-screen {
        width: 240px;
        height: 480px;
    }
}
