/* ===== BASE: Variables, Reset, Layout, Navigation ===== */

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

:root {
    /* Brand Colors (Cream/Chocolate Theme) */
    --brand-pink: #8B6914;   /* Protecting Beauty */
    --brand-blue: #5B7B8C;   /* Empowering Safety */
    --brand-gold: #8B6914;   /* 골드 브라운 */
    
    /* Base Colors - Cream/Chocolate Theme */
    --primary: #3D2B1F;                 /* 초콜릿 브라운 - 메인 */
    --primary-light: #6B5744;           /* 라이트 브라운 */
    --primary-hover: #2A1A0F;          /* 호버 */
    --bg: #FFF8F0;                      /* 크림 아이보리 배경 */
    --bg-secondary: #FFF8F0;           /* 밝은 크림 */
    --bg-card: #F7F3ED;                /* 카드 배경 */
    --text: #3D2B1F;                   /* 초콜릿 브라운 글씨 */
    --text-secondary: #6B5744;         /* 보조 글씨 */
    --border: #E8E0D8;                 /* 보더/구분선 */
    
    /* Accent & Links */
    --gold: #8B6914;                   /* 링크/액센트 */
    --gold-light: #F0C060;             /* 밝은 골드 */
    --gold-accent: #C9A84C;            /* 골드 액센트 */
    --accent: #8B6914;                 /* 액센트 컬러 */
    
    /* Button Colors */
    --btn-primary-bg: #3D2B1F;
    --btn-primary-text: #FFF8F0;
    --btn-hover-bg: #2A1A0F;
    
    /* Sidebar Colors */
    --sidebar-bg: #3D2B1F;
    --sidebar-text: #E8D5C4;
    
    /* Legacy Compat (기존 코드 깨짐 방지) */
    --primary-legacy: #3D2B1F;
    --gold-dark: #8B6914;
    --cream: #FFF8F0;
    --cream-dark: #F7F3ED;
    --bg-card-alt: #FFF8F0;
    --text-light: #6B5744;
    --text-muted: #6B5744;
    --white: #FFF8F0;
    --card-bg: #F7F3ED;
    --success: #6B8F3C;                /* 자연 녹색 */
    --warning: #C4841D;                /* 경고/에러 기존 유지 */
    --error: #B54534;
    --danger: #B54534;
    --info: #5B7B8C;

    /* Legacy aliases - Light Theme */
    --dark-bg: #FFF8F0;
    --dark-card: #F7F3ED;
    --dark-card-alt: #F7F3ED;
    --dark-border: #E8E0D8;
    --dark-text: #3D2B1F;
    --dark-muted: #6B5744;
    --dark-gold: #8B6914;
    --dark-cream: #FFF8F0;
}


/* Landing Specific Styles */
#landing-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: #FFF8F0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    -webkit-overflow-scrolling: none;
    touch-action: none;
}
.hidden { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}


/* Auth Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61,43,31,0.5); /* TODO: Convert to CSS custom property rgba() */
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border);
    color: var(--text);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-form h3 {
    margin-bottom: 1rem;
}

.auth-form .input {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text) !important;
    background: var(--bg) !important;
    font-size: 1rem !important;
}

.auth-form .input::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.9 !important;
}

.auth-form p {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.auth-form a {
    color: var(--text);
    text-decoration: underline;
}

.user-info {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.user-info p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}


/* Mobile Menu Toggle */
.menu-toggle {
    display: block;
    position: fixed;
    top: 0.4rem;
    left: 0.4rem;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(61,43,31,0.15);
    color: var(--text);
    line-height: 0;
}


/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: none;
    padding: 1rem 0;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar.active {
    transform: translateX(0);
}

.logo {
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(210,188,176,0.1);
    margin-bottom: 0.5rem;
    cursor: pointer;
    text-align: right;
}

.logo h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
    color: var(--gold);
}

.logo p {
    font-size: 0.8rem;
    color: var(--gold-dark);
    letter-spacing: 1px;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav-sub {
    display: block;
    font-size: 0.6rem;
    opacity: 0.5;
    font-weight: 400;
    margin-top: 1px;
    letter-spacing: 0;
}
html[lang="en"] .nav-sub { display: none; }

.nav-item {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(210,188,176,0.08);
    color: var(--gold);
}

.nav-item.active {
    background: rgba(255,215,0,0.1);
    border-left: 3px solid var(--gold);
    color: var(--gold);
    font-weight: 600;
}

.sidebar .nav-divider {
    border: none;
    border-top: 1px solid rgba(210,188,176,0.08);
    margin: 0.4rem 1rem;
}

.sidebar .nav-group-label {
    padding: 0.5rem 1rem 0.2rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(210,188,176,0.3);
    font-weight: 700;
}

/* Main Content */
.content {
    margin-left: 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

p, span, label {
    color: var(--text);
}

button {
    color: var(--text);
}

a {
    color: var(--text);
}


/* Buttons */
.btn-primary {
    background: var(--gold);
    color: var(--btn-primary-text);
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--gold-accent);
    color: var(--btn-primary-text);
}

.btn-buy {
    background: var(--text);
    color: var(--btn-primary-text);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-buy:hover {
    opacity: 0.9;
}


