/*
Theme Name: Korean District Theme
Theme URI: https://example.com/korean-district-theme
Author: xAI Assistant
Author URI: https://example.com
Description: A custom WordPress theme migrated from the provided HTML, CSS, and JS files for an interactive K-Culture hub.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: korean-district
*/

/* 1. SETUP: Variables and Basic Styles */
:root {
    --bg-color: #f8f8fa;
    --text-color: #1a1a1a;
    --card-bg: #ffffff;
    --border-color: #e8e8e8;
    --primary-color: #ff4775;
    --font-main: 'Inter', 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #333333;
}

body {
    font-family: var(--font-main);
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 2. ADVANCED FEATURES: Animations, Dark Mode Toggle */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
.card.animate-on-scroll:nth-child(2) {
    transition-delay: 0.1s;
}
.card.animate-on-scroll:nth-child(3) {
    transition-delay: 0.2s;
}
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked+.slider {
    background-color: var(--primary-color);
}
input:checked+.slider:before {
    transform: translateX(26px);
}

/* 3. LAYOUT: Header, Main, Footer */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 5%;
    transition: background-color 0.3s ease, border-bottom 0.3s ease;
}
body.dark-mode .main-header {
    background-color: rgba(30, 30, 30, 0.7);
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-color);
    text-decoration: none;
    z-index: 1001;
}
.nav-menu {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}
.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2.5rem;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.2s ease;
}
.nav-links a:hover {
    color: var(--primary-color);
}
.nav-toggle {
    display: none;
}
main {
    padding: 2rem 5%;
    max-width: 1200px;
    margin: auto;
}
.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 2rem;
}
.main-footer {
    text-align: center;
    padding: 3rem 5%;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: #888;
}

/* 4. COMPONENTS: Hero, Cards, Buttons */
.hero-banner {
    text-align: center;
    padding: 6rem 1rem;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    margin-bottom: 4rem;
}
.hero-content {
    color: white;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}
.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    opacity: 0.9;
    line-height: 1.5;
}
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}
.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 71, 117, 0.4);
}
.btn-secondary {
    background-color: var(--text-color);
    color: var(--bg-color);
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
}
.card-image {
    height: 180px;
    background-color: #e8e8e8;
    background-size: cover;
    background-position: center;
    transition: transform .4s ease;
}
.card:hover .card-image {
    transform: scale(1.05);
}
.card-content {
    padding: 1.5rem;
}
.card-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}
.card-title {
    font-size: 1.3rem;
    margin: 0.5rem 0 0 0;
    color: var(--text-color);
    line-height: 1.4;
}
.feature-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 2rem;
}
.feature-image {
    width: 40%;
    min-height: 250px;
    flex-shrink: 0;
    background-color: #dcdcdc;
    background-size: cover;
    background-position: center;
}
.feature-content {
    padding: 2rem;
}
.feature-content h3,
.feature-content p {
    line-height: 1.5;
}

/* 5. GAMIFICATION: Profile Status */
.profile-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}
.profile-level {
    color: var(--primary-color);
}
.exp-bar {
    width: 100px;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}
.exp-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease;
}
.profile-exp {
    font-size: 0.8rem;
    color: #888;
}

/* 6. LANGUAGE SELECTOR & KOREAN TEXT STYLE */
.language-selector {
    margin-left: 1rem;
}
.language-selector select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 20px;
    font-family: var(--font-main);
    font-weight: 700;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%2724%27%20height%3D%2724%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27%23888%27%20d%3D%27M7%2010l5%205%205-5z%27%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}
.korean-text {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 0.25rem;
    font-weight: 400;
}
body.dark-mode .korean-text {
    color: #777;
}

/* 7. RESPONSIVE DESIGN: Mobile View */
@media (max-width: 900px) {
    .nav-toggle {
        display: block;
        background: transparent;
        border: 0;
        cursor: pointer;
        padding: 0.5rem;
        z-index: 1001;
    }
    .hamburger {
        display: block;
        position: relative;
        width: 24px;
        height: 2px;
        background: var(--text-color);
        transition: transform 0.3s ease;
    }
    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background: var(--text-color);
        transition: transform 0.3s ease, top 0.3s ease;
    }
    .hamburger::before {
        top: -8px;
    }
    .hamburger::after {
        top: 8px;
    }
    .nav-open .hamburger {
        background: transparent;
    }
    .nav-open .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    .nav-open .hamburger::after {
        transform: rotate(-45deg);
        top: 0;
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 60%;
        min-width: 250px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
        transition: right 0.4s ease-in-out;
        padding: 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    .nav-open .nav-menu {
        right: 0;
    }
    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 0;
    }
    .auth-buttons,
    .profile-status,
    .language-selector,
    .theme-switch-wrapper {
        margin: 0;
    }
    .auth-buttons {
        order: -2;
        margin-bottom: 1rem;
    }
    .profile-status {
        order: -1;
        margin-bottom: 1rem;
    }
    .language-selector {
        order: -1;
        margin-bottom: 1rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .card-container {
        grid-template-columns: 1fr;
    }
    .feature-card {
        flex-direction: column;
    }
    .feature-image {
        width: 100%;
        min-height: 200px;
    }
}

/* 8. AUTHENTICATION: Login Button & Modal */
.auth-buttons {
    margin-right: 1rem;
}
.auth-buttons .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}
#user-profile-display.hidden {
    display: none;
}
.auth-buttons.hidden {
    display: none;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content {
    transform: translateY(0);
}
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}
.form-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.form-actions .btn {
    width: 100%;
}
.modal-message {
    text-align: center;
    font-weight: 700;
    min-height: 20px;
}
.modal-message.success {
    color: #28a745;
}
.modal-message.error {
    color: #dc3545;
}