/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #00bf60;
    --primary-blue: #0080FF;
    --text-dark: #333;
    --text-gray: #666;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --border-color: #e0e0e0;
    --header-h: 80px;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
}

.media-img {
    width: 100%;
    height: auto;
    display: block;
}

.media-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.thumb-16x9 {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
}

.thumb-4x3 {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
}


a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background-color: #00a854;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background-color: var(--primary-green);
    color: white;
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-secondary:hover {
    background-color: #0066cc;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* Header */
.header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 80px;
    width: auto;
    background: transparent;
}

.logo-text {
    color: var(--primary-green);
    font-size: 24px;
    font-weight: bold;
}

.nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    gap: 24px;
}

.nav-item {
    position: relative;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    display: none;
    z-index: 1000;
}

.nav-item:hover .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
    color: var(--text-dark);
}

.submenu li a:hover {
    background: #f5f5f5;
    color: var(--primary-green);
}

.nav-list li a,
.nav-list li .nav-link {
    font-size: 15px;
    font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    font-weight: 700;
    transition: color 0.3s;
    white-space: nowrap;
    padding: 8px 4px;
}

.nav-list li a:hover,
.nav-list li .nav-link:hover {
    color: var(--primary-green);
}

.nav-link--static {
    cursor: default;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.auth-buttons .btn {
    white-space: nowrap;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-white);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav-list {
    padding: 20px;
}

.mobile-nav-list li {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list li:last-child {
    border-bottom: none;
}

.mobile-has-submenu {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.mobile-submenu {
    padding: 8px 0 0 12px;
    display: none;
}

.mobile-submenu li {
    padding: 8px 0;
    border-bottom: none;
}

.mobile-has-submenu.open .mobile-submenu {
    display: block;
}

.mobile-submenu a {
    font-size: 14px;
    color: var(--text-gray);
}

.mobile-nav-list a,
.mobile-nav-list .mobile-nav-link {
    font-size: 16px;
    font-family: 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    font-weight: 700;
    display: block;
    transition: color 0.3s;
}

.mobile-nav-list a:hover,
.mobile-nav-list .mobile-nav-link:hover {
    color: var(--primary-green);
}

/* Messages */
.messages {
    position: fixed;
    top: var(--header-h);
    right: 20px;
    z-index: 1001;
    max-width: 400px;
}

.alert {
    padding: 15px 40px 15px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - var(--header-h) - 200px);
}

/* Floating Button */
.floating-btn {
    position: fixed;
    right: 20px;
    bottom: 100px;
    background-color: var(--primary-green);
    color: white;
    padding: 15px 20px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 191, 96, 0.4);
    transition: all 0.3s;
    z-index: 100;
}

.floating-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 191, 96, 0.5);
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 40px 0 20px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid #3d5166;
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}

.footer-info p {
    font-size: 13px;
    margin-bottom: 5px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    font-size: 13px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* Section */
.section {
    padding: 60px 0;
}

.page-placeholder {
    text-align: center;
    color: var(--text-gray);
    font-size: 15px;
    margin-top: 10px;
}

.section-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.section-title span {
    color: var(--primary-green);
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 60px;
    height: 60px;
    background-color: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.card p {
    color: var(--text-gray);
    font-size: 14px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check-input {
    width: 18px;
    height: 18px;
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.auth-container .btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    color: var(--text-gray);
}

.auth-links a {
    color: var(--primary-green);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--bg-light);
    font-weight: 600;
}

tr:hover {
    background-color: var(--bg-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a, .pagination span {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination .current {
    background-color: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

/* Page Header */
.page-header {
    background-color: var(--bg-light);
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-dark);
}

/* Content Box */
.content-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

/* Post Detail */
.post-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.post-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.post-meta {
    color: var(--text-gray);
    font-size: 14px;
}

.post-content {
    line-height: 1.8;
    min-height: 200px;
}

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Comments */
.comments-section {
    margin-top: 40px;
}

.comments-title {
    font-size: 18px;
    margin-bottom: 20px;
}

.comment {
    padding: 15px;
    background-color: var(--bg-light);
    border-radius: 5px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    color: var(--text-gray);
    font-size: 13px;
}

.comment-content {
    font-size: 14px;
}

/* School Logos Slider */
.school-slider {
    background-color: var(--bg-light);
    padding: 40px 0;
    overflow: hidden;
}

.school-slider-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 20px;
}

.school-logos {
    display: flex;
    gap: 40px;
    animation: scroll 30s linear infinite;
}

.school-logo {
    flex-shrink: 0;
    width: 120px;
    height: 60px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s;
}

.school-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Quiz Demo */
.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.subject-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.subject-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
}

.subject-card.active {
    border-color: var(--primary-green);
    background-color: #f0fff5;
}

.subject-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.quiz-container {
    max-width: 800px;
    margin: 40px auto;
}

.quiz-question {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.quiz-question h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    border-color: var(--primary-green);
}

.quiz-option.selected {
    border-color: var(--primary-green);
    background-color: #f0fff5;
}

.quiz-option.correct {
    border-color: var(--primary-green);
    background-color: #d4edda;
}

.quiz-option.wrong {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Responsive - 태블릿 (1024px 이하) - 햄버거 메뉴로 전환 */
@media (max-width: 1024px) {
    :root {
        --header-h: 70px;
    }

    .logo-img {
        height: 60px;
    }

    .nav, .auth-buttons {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-list {
        gap: 16px;
    }

    .nav-list li a,
    .nav-list li .nav-link {
        font-size: 14px;
    }
}

/* Responsive - 모바일 (768px 이하) */
@media (max-width: 768px) {
    :root {
        --header-h: 60px;
    }

    .logo-img {
        height: 50px;
    }


    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 16px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 20px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .auth-container {
        margin: 20px;
        padding: 25px;
    }

    .floating-btn {
        right: 15px;
        bottom: 80px;
        padding: 12px 16px;
        font-size: 14px;
    }

    .messages {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (min-width: 1025px) {
    .mobile-menu {
        display: none !important;
    }

    .mobile-menu-btn {
        display: none;
    }

    .nav, .auth-buttons {
        display: flex;
    }
}

/* Responsive - 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    :root {
        --header-h: 56px;
    }
    .container {
        padding: 0 15px;
    }


    .logo-img {
        height: 45px;
    }


    .mobile-nav-list {
        padding: 15px;
    }

    .mobile-nav-list li {
        padding: 12px 0;
    }

    .mobile-nav-list a,
    .mobile-nav-list .mobile-nav-link {
        font-size: 15px;
    }

    .footer {
        padding: 30px 0 15px;
    }

    .company-name {
        font-size: 16px;
    }

    .footer-info p {
        font-size: 12px;
    }

    .footer-links a {
        font-size: 13px;
    }

    .footer-bottom {
        font-size: 12px;
    }

    .floating-btn {
        right: 10px;
        bottom: 70px;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* ===== Utilities: line clamp ===== */
.clamp-1,
.clamp-2,
.clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.clamp-1 {
    line-clamp: 1;
    -webkit-line-clamp: 1;
}

.clamp-2 {
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.clamp-3 {
    line-clamp: 3;
    -webkit-line-clamp: 3;
}
