/* CSS Variables */
:root {
    --bg-primary: #fff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #f9f9f9;
    --bg-hover: #fafafa;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #888;
    --text-muted: #999;
    --text-content: #444;
    --accent: #e57373;
    --accent-hover: #d32f2f;
    --border-color: #eee;
    --border-light: #ddd;
    --shadow: rgba(0,0,0,0.1);
    --shadow-strong: rgba(0,0,0,0.2);
    --card-shadow: rgba(0,0,0,0.1);
    --footer-bg: #2c2c2c;
    --footer-social-bg: rgba(255,255,255,0.1);
    --disabled: #ccc;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #303030;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #999;
    --text-muted: #777;
    --text-content: #c0c0c0;
    --accent: #ff7a7a;
    --accent-hover: #ff5252;
    --border-color: #444;
    --border-light: #555;
    --shadow: rgba(0,0,0,0.3);
    --shadow-strong: rgba(0,0,0,0.4);
    --card-shadow: rgba(0,0,0,0.4);
    --footer-bg: #111;
    --footer-social-bg: rgba(255,255,255,0.15);
    --disabled: #555;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s, color 0.3s;
}

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

/* Header Styles */
.header {
    background: var(--bg-primary);
    box-shadow: 0 2px 5px var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo a {
    text-decoration: none;
}

.logo span {
    color: var(--text-primary) !important;
    transition: color 0.3s;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-item {
    position: relative;
}

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

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

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    box-shadow: 0 4px 6px var(--shadow);
    list-style: none;
    min-width: 200px;
    padding: 10px 0;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 10px 20px;
}

.dropdown-menu a {
    display: block;
}

/* Global Nav Bar (GNB) — slim top bar on subsites for returning to academy main */
.gnb {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: var(--text-primary);
    color: var(--bg-primary);
    z-index: 1001;
    font-size: 0.88rem;
    transition: background 0.3s;
}

.gnb .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.gnb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.95;
    transition: opacity 0.3s, color 0.3s;
}

.gnb-brand:hover {
    opacity: 1;
    color: var(--accent);
}

.gnb-brand::before {
    content: "←";
    font-size: 1rem;
    opacity: 0.7;
}

.gnb-nav ul {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gnb-nav a {
    color: var(--bg-primary);
    text-decoration: none;
    opacity: 0.82;
    transition: opacity 0.3s, color 0.3s;
}

.gnb-nav a:hover {
    opacity: 1;
    color: var(--accent);
}

/* GNB dropdown — for subsite links shown in slim top bar */
.gnb-nav .gnb-dropdown {
    position: relative;
}

.gnb-nav .gnb-dropdown > a::after {
    content: " ▾";
    font-size: 0.75rem;
    opacity: 0.7;
}

.gnb-nav .gnb-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    box-shadow: 0 4px 8px var(--shadow-strong);
    list-style: none;
    min-width: 180px;
    padding: 8px 0;
    margin: 0;
    z-index: 1002;
}

.gnb-nav .gnb-dropdown:hover .gnb-dropdown-menu {
    display: block;
}

.gnb-nav .gnb-dropdown-menu li {
    padding: 0;
}

.gnb-nav .gnb-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
    opacity: 0.88;
}

/* When GNB is present, push header and content below it */
body.has-gnb .header {
    top: 40px;
}

@media (max-width: 900px) {
    .gnb-nav {
        display: none;
    }
}

/* Hero Section */
.hero {
    margin-top: 80px;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.8;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-strong);
}

/* Programs Section */
.programs {
    padding: 80px 0;
    background: var(--bg-secondary);
    transition: background 0.3s;
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.program-card {
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px var(--card-shadow);
    transition: transform 0.3s, background 0.3s;
}

.program-card:hover {
    transform: translateY(-5px);
}

.program-image {
    height: 250px;
    overflow: hidden;
}

.program-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.program-content {
    padding: 30px;
}

.program-subtitle {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.program-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.program-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

.btn-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.btn-link:hover {
    color: var(--accent-hover);
}

/* Gallery Section */
.gallery {
    padding: 60px 0;
    background: var(--bg-primary);
    transition: background 0.3s;
}

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

.gallery-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* Corporate Section */
.corporate {
    padding: 100px 0;
    text-align: center;
    color: #fff;
}

.corporate-title {
    font-size: 2rem;
    margin-bottom: 30px;
    line-height: 1.8;
}

.highlight {
    color: var(--accent);
    font-weight: 700;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background: var(--accent);
    color: #fff;
    text-align: center;
    transition: background 0.3s;
}

.contact-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.contact-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.contact-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-contact {
    padding: 15px 40px;
    background: var(--bg-primary);
    color: var(--accent);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-contact:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-strong);
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: #fff;
    padding: 40px 0;
    transition: background 0.3s;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer-social a {
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--footer-social-bg);
    transition: all 0.3s;
}

.footer-social a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

/* Dark Mode Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-primary);
    transition: color 0.3s;
    line-height: 0;
    display: flex;
    align-items: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    color: var(--text-primary);
    transition: color 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
        position: fixed;
        top: 80px;
        left: -100%;
        background: var(--bg-primary);
        width: 80%;
        padding: 20px;
        transition: left 0.3s, background 0.3s;
        box-shadow: 2px 0 10px var(--shadow);
        height: calc(100vh - 80px);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        min-width: 0;
        padding: 0;
        background: var(--bg-tertiary);
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        padding: 8px 20px 8px 30px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

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

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .corporate-title {
        font-size: 1.5rem;
    }

    .contact-title {
        font-size: 2rem;
    }
}
