:root, body[data-theme="light"] {
    --bg-main: #f0fdf4;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-inactive: #94a3b8;
    --text-active-btn: #064e3b;
    --border-color: rgba(16, 185, 129, 0.4);
    --brand-blue: #059669;
    --accent-color: #10b981;
    --accent-hover: #047857;
    --glow-color: rgba(16, 185, 129, 0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(240, 253, 244, 0.88);
    --nav-border: rgba(16, 185, 129, 0.25);
    --nav-text: #0f172a;
    --nav-text-sub: #475569;
}

body[data-theme="dark"] {
    --bg-main: #050d0a;
    --bg-card: rgba(10, 22, 18, 0.85);
    --bg-card-hover: rgba(16, 38, 30, 0.98);
    --text-primary: #f0fdf4;
    --text-secondary: #94e7b7;
    --text-inactive: #618774;
    --text-active-btn: #ffffff;
    --border-color: rgba(52, 211, 153, 0.35);
    --brand-blue: #064e3b;
    --accent-color: #10b981;
    --accent-hover: #34d399;
    --glow-color: rgba(16, 185, 129, 0.55);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.85);
    --nav-bg: rgba(10, 14, 12, 0.92);
    --nav-border: #1E2E28;
    --nav-text: #FFFFFF;
    --nav-text-sub: #B0B0B0;
}

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

html, body {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main, #050d0a);
}

.navbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 24px !important;
    background-color: var(--nav-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    box-sizing: border-box !important;
    flex-wrap: nowrap;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-left {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    gap: 16px;
    min-width: 0;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-left::-webkit-scrollbar {
    display: none;
}

.logo-area {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    flex-shrink: 0;
}

.logo-link {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    text-decoration: none;
}

.logo-img {
    height: 28px !important;
    max-height: 28px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

body[data-theme="dark"] .theme-logo-dark { display: block !important; }
body[data-theme="dark"] .theme-logo-light { display: none !important; }
body[data-theme="light"] .theme-logo-dark { display: none !important; }
body[data-theme="light"] .theme-logo-light { display: block !important; }
:root:not([data-theme="light"]) .theme-logo-dark { display: block !important; }
:root:not([data-theme="light"]) .theme-logo-light { display: none !important; }

.nav-menu {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--nav-text-sub);
    font-weight: 800;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    display: inline-block;
    white-space: nowrap;
}

.nav-menu a.active {
    color: var(--nav-text);
    background-color: rgba(0, 230, 161, 0.18);
    border: 2px solid #00E6A1;
    box-shadow: 0 0 18px rgba(0, 230, 161, 0.3);
    font-weight: 900;
}

.nav-menu a:hover:not(.active) {
    color: var(--nav-text);
    border-color: rgba(0, 230, 161, 0.3);
    background-color: rgba(16, 185, 129, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--nav-border);
    background-color: rgba(16, 185, 129, 0.06);
    color: var(--nav-text-sub);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    border-color: #00E6A1;
    box-shadow: 0 0 15px rgba(0, 230, 161, 0.35);
    color: var(--nav-text);
}

.auth-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-auth {
    background-color: #00E6A1;
    color: #000000;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 230, 161, 0.4);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-auth:hover { transform: translateY(-1px); filter: brightness(1.08); }

.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(16, 185, 129, 0.08);
    padding: 3px 8px;
    border-radius: 16px;
    border: 1px solid var(--nav-border);
}

.profile-container { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.profile-img-nav { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid #00E6A1; background-color: #FFFFFF; }
.nickname-highlight { font-size: 13px; font-weight: 800; color: #059669; }
body[data-theme="dark"] .nickname-highlight { color: #00E6A1; }
.honorific-suffix { font-size: 11px; font-weight: 500; color: var(--nav-text-sub); }
.btn-setting { background: transparent; border: none; color: var(--nav-text-sub); font-size: 13px; cursor: pointer; padding: 2px; }
.btn-logout { background: transparent; border: 1px solid #EF4444; color: #EF4444; padding: 3px 6px; border-radius: 6px; font-size: 11px; font-weight: bold; cursor: pointer; white-space: nowrap; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal-overlay.active { display: flex !important; }

.modal-card {
    background-color: #0A0E0C !important;
    width: 100% !important;
    max-width: 420px !important;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px !important;
    border: 1px solid #1E2E28 !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 230, 161, 0.2) !important;
    padding: 24px 20px !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #FFFFFF !important;
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title-wrap { display: flex; align-items: center; gap: 8px; }
.modal-title-text, .login-icon { color: #00E6A1 !important; font-size: 20px !important; font-weight: 900 !important; }
.btn-close-modal {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid #1E2E28 !important;
    color: #94a3b8 !important;
    width: 28px !important; height: 28px !important;
    border-radius: 50% !important;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.login-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.form-group label { font-size: 12px; font-weight: 700; color: #FFFFFF !important; }
.form-group input {
    width: 100%; padding: 11px 14px; border-radius: 10px;
    background-color: #0F1612 !important; border: 1px solid #1E2E28 !important;
    color: #FFFFFF !important; font-size: 14px; outline: none;
}
.form-group input:focus { border-color: #00E6A1 !important; box-shadow: 0 0 10px rgba(0, 230, 161, 0.4) !important; }

.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.btn-check-dup {
    background-color: rgba(0, 230, 161, 0.1) !important; color: #00E6A1 !important;
    border: 1px solid #1E2E28 !important; padding: 0 12px; border-radius: 10px;
    font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap;
}

.btn-email-login, .btn-submit-signup {
    width: 100%; padding: 12px; border-radius: 10px; border: none !important;
    background-color: #00E6A1 !important; color: #000000 !important;
    font-size: 14px; font-weight: 900; cursor: pointer; margin-top: 4px;
}

.divider { position: relative; text-align: center; margin: 16px 0; }
.divider::before {
    content: ''; position: absolute; top: 50%; left: 0; width: 100%; height: 1px;
    background-color: #1E2E28; z-index: 1;
}
.divider span {
    position: relative; background-color: #0A0E0C !important;
    padding: 0 10px; color: #B0B0B0; font-size: 12px; z-index: 2;
}

.social-btn-group { display: flex; flex-direction: column; gap: 8px; }
.btn-social-auth {
    width: 100%; height: 42px; border-radius: 10px; border: none;
    font-size: 13px; font-weight: 700; cursor: pointer; display: flex;
    align-items: center; justify-content: center; gap: 8px;
}
.btn-auth-google { background-color: #FFFFFF; color: #111827; }
.btn-auth-apple { background-color: #000000; color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.15); }
.btn-auth-kakao { background-color: #FACC15; color: #000000; }
.btn-auth-naver { background-color: #00C73C; color: #FFFFFF; }

.modal-footer-links { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; }
.footer-link { color: #94a3b8; text-decoration: none; }
.footer-link.highlight { color: #00E6A1 !important; font-weight: 700; cursor: pointer; }

.profile-upload-area {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 10px auto 16px auto;
    cursor: pointer;
}

.profile-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00E6A1;
    background-color: #1E2E28;
    box-shadow: 0 0 15px rgba(0, 230, 161, 0.3);
    display: block;
}

.profile-upload-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #12181f;
    border: 1px solid #1E2E28;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nickname-msg {
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

.custom-alert-card { max-width: 400px !important; padding: 0 !important; }
.confirm-header { padding: 24px; display: flex; gap: 14px; align-items: center; }
.confirm-icon { font-size: 32px; color: #00E6A1; }
.confirm-title { font-size: 18px; font-weight: 900; color: #FFFFFF; }
.confirm-desc { font-size: 13px; color: #B0B0B0; margin-top: 4px; }
.modal-actions { padding: 16px 24px; display: flex; justify-content: flex-end; gap: 10px; background-color: rgba(255, 255, 255, 0.02); border-top: 1px solid #1E2E28; }
.btn-cancel { background-color: rgba(255, 255, 255, 0.03); border: 1px solid #1E2E28; padding: 10px 18px; border-radius: 8px; font-weight: bold; color: #94a3b8; cursor: pointer; }
.btn-confirm { background-color: #00E6A1; color: #000000; border: none; padding: 10px 18px; border-radius: 8px; font-weight: 900; cursor: pointer; }

/* 모바일 반응형 최적화 (768px 이하) */
@media (max-width: 768px) {
    .navbar {
        height: 52px !important;
        min-height: 52px !important;
        padding: 0 10px !important;
        gap: 6px;
    }
    .nav-left {
        gap: 6px;
        flex-shrink: 1;
        min-width: 0;
    }
    .logo-img {
        height: 22px !important;
        max-height: 22px !important;
    }
    .nav-menu {
        gap: 3px;
        flex-shrink: 0;
    }
    .nav-menu a {
        font-size: 11px;
        padding: 5px 6px;
        border-radius: 6px;
        border-width: 1.5px;
        white-space: nowrap;
    }
    .nav-actions {
        gap: 5px;
        flex-shrink: 0;
    }
    .theme-toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
        border-radius: 7px;
    }
    .btn-auth {
        padding: 5px 8px;
        font-size: 11px;
        border-radius: 6px;
        white-space: nowrap;
    }
    .user-info {
        padding: 2px 6px;
        gap: 4px;
        border-radius: 12px;
    }
    .profile-img-nav {
        width: 20px;
        height: 20px;
        border-width: 1px;
    }
    .nickname-highlight {
        font-size: 11px;
        max-width: 48px;
        display: inline-block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .honorific-suffix {
        display: none;
    }
    .btn-setting {
        font-size: 11px;
        padding: 1px;
    }
    .btn-logout {
        padding: 2px 4px;
        font-size: 9px;
        border-radius: 4px;
    }
}