/* KCA Portal Modern CSS */
:root {
    --primary-color: #3b2f2f; /* Coffee Brown */
    --accent-color: #d4a373;  /* Latte Gold */
    --success-color: #606c38;
    --danger-color: #bc6c25;
    --text-main: #2b2d42;
    --text-muted: #8d99ae;
    --bg-main: #fefae0;
    --bg-white: #ffffff;
    --border-color: #e9edc9;
    --shadow: 0 10px 30px -5px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Noto Sans KR', sans-serif; }
body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    line-height: 1.7; 
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3BaseFilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/baseFilter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-attachment: fixed;
    opacity: 0.98;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* Header & Mega Menu */
.main-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.logo { font-size: 1.6rem; font-weight: 900; color: var(--primary-color); letter-spacing: -1px; }

.nav-menu ul { list-style: none; display: flex; gap: 30px; }
.nav-menu li { position: relative; }
.nav-menu a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: 1rem; transition: 0.3s; }
.nav-menu a:hover { color: var(--accent-color); }

/* Dropdown */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    padding: 15px 0;
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li { width: 100%; }
.dropdown a {
    padding: 10px 25px;
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.dropdown a:hover { background: #f8f9fa; color: var(--primary-color); }

.btn-cert {
    background: var(--primary-color);
    color: white !important;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
    transition: 0.3s;
    border: none;
    box-shadow: 0 4px 15px rgba(59, 47, 47, 0.2);
}

.btn-cert:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 163, 115, 0.4);
    background: var(--accent-color);
}

.btn-login {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
}

/* Hero Section */
.home-hero { padding: 100px 0 80px; background: linear-gradient(180deg, #fff 0%, var(--bg-main) 100%); text-align: center; }
.hero-text h1 { font-size: 3.2rem; font-weight: 900; margin-bottom: 20px; color: var(--primary-color); }
.highlight { color: var(--accent-color); position: relative; }
.highlight::after { content: ''; position: absolute; bottom: 10px; left: 0; width: 100%; height: 12px; background: rgba(212, 163, 115, 0.2); z-index: -1; }

/* News Hero (homepage top) */
.news-hero {
    padding: 80px 0 40px;
    background: linear-gradient(180deg, #fff 0%, var(--bg-main) 100%);
    text-align: center;
}
.news-hero-inner { max-width: 900px; margin: 0 auto; }
.news-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin: 14px 0 20px;
    color: var(--primary-color);
    line-height: 1.3;
}
.news-hero .hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 28px;
}
.hero-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}
.cat-chip {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}
.cat-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* Featured Article Card */
.featured-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 30px;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #fefae0 100%);
    border: 2px solid var(--accent-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px -10px rgba(59, 47, 47, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -12px rgba(212, 163, 115, 0.2);
}
.featured-emoji {
    font-size: 7rem;
    text-align: center;
    line-height: 1;
}
.featured-body { text-align: left; }
.featured-cat {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.featured-body h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.4;
}
.featured-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.featured-summary {
    color: var(--text-main);
    font-size: 0.98rem;
    line-height: 1.75;
    margin-bottom: 18px;
}
.featured-more {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 0.95rem;
}
@media (max-width: 768px) {
    .news-hero { padding: 50px 0 30px; }
    .news-hero h1 { font-size: 1.8rem; }
    .news-hero .hero-subtitle { font-size: 0.95rem; }
    .featured-card {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 16px;
    }
    .featured-emoji { font-size: 4rem; }
    .featured-body h3 { font-size: 1.2rem; }
}

/* Grid Systems */
.cert-grid, .other-certs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 50px; }
.other-certs-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }

.cert-card, .mini-card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 24px;
    border: 1px solid rgba(233, 237, 201, 0.5);
    box-shadow: 
        0 10px 20px -5px rgba(59, 47, 47, 0.05),
        0 20px 40px -10px rgba(59, 47, 47, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: center;
}

.mini-card { padding: 25px; border-radius: 16px; }
.mini-card h4 { margin-bottom: 5px; color: var(--primary-color); }

.cert-card:hover, .mini-card:hover {
    transform: translateY(-12px);
    box-shadow:
        0 30px 60px -12px rgba(212, 163, 115, 0.15),
        0 18px 36px -18px rgba(212, 163, 115, 0.2);
    border-color: var(--accent-color);
}

/* Cert Card Inner Elements */
.cert-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.cert-tag.primary { background: #e0f2fe; color: #0369a1; }
.cert-tag.danger { background: #fef2f2; color: #b91c1c; }
.cert-tag.success { background: #dcfce7; color: #166534; }

.cert-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    line-height: 1;
}

.cert-card h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.cert-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 20px;
}

.accent-card {
    background: linear-gradient(135deg, #ffffff 0%, #fefae0 100%);
    border: 2px solid var(--accent-color);
}

.badge {
    background: rgba(212, 163, 115, 0.1);
    color: var(--accent-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: inline-block;
}

/* Roadmap */
.roadmap-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 40px;
    border-radius: 30px;
    margin-bottom: 60px;
    border: 1px solid var(--border-color);
}

.roadmap-step { flex: 1; text-align: center; }
.step-num { width: 50px; height: 50px; background: var(--accent-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 15px; font-weight: 900; }
.success-step .step-num { background: var(--success-color); }

/* Info Hub */
.info-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-top: 40px; }
.info-box { background: white; padding: 35px; border-radius: 24px; border: 1px solid var(--border-color); }
.info-box h3 { margin-bottom: 20px; display: flex; align-items: center; gap: 10px; color: var(--primary-color); }
.info-box ul { list-style: none; }
.info-box li { padding: 12px 0; border-bottom: 1px dashed #eee; font-size: 0.95rem; color: var(--text-main); }
.more-link { display: inline-block; margin-top: 20px; color: var(--accent-color); font-weight: 700; text-decoration: none; }

/* Sections */
.section { padding: 100px 0; border-bottom: 1px solid var(--border-color); }
.section.no-border { border-bottom: none; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 2.2rem; font-weight: 900; color: var(--primary-color); }
.section-title p { color: var(--text-muted); font-size: 1rem; margin-top: 10px; }

/* Quiz Header & Controls */
.quiz-header { margin-bottom: 40px; }
.quiz-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.quiz-status { font-weight: 900; color: var(--primary-color); font-size: 1.1rem; }

.btn-shuffle {
    background: white;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-shuffle:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.quiz-progress-bar { height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.progress { height: 100%; background: var(--accent-color); transition: 0.5s; width: 0%; }
.quiz-footer { display: flex; justify-content: space-between; margin-top: 40px; }

.btn-nav { padding: 16px 35px; border-radius: 12px; border: none; font-weight: 800; cursor: pointer; transition: 0.2s; }
.btn-nav.outline { background: #f8f9fa; color: var(--text-muted); }
.btn-nav.fill { background: var(--primary-color); color: white; }

/* Fee Info Styles */
.fee-info-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.fee-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    text-align: center;
    min-width: 320px;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.fee-total {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--danger-color);
}

.fee-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Complex Table Styles */
.complex-table th {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.complex-table td {
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
    vertical-align: middle;
}

.round-num { font-weight: 800; background: #f1f3f5; }
.type-special { color: var(--danger-color); font-weight: 700; }
.type-general { color: var(--primary-color); font-weight: 700; }
.bg-light { background: #fafbfc; }

/* Tab Styles */
.tab-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: 1px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.main-footer { padding: 80px 0; background: #f1f3f5; color: var(--text-muted); }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; margin: 0 10px; }

/* Tablet */
@media (max-width: 1024px) {
    .cert-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
    .info-hub { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; }
}

/* Mobile */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; height: auto; padding: 15px; gap: 10px; }
    .nav-menu ul { gap: 12px; flex-wrap: wrap; justify-content: center; }
    .roadmap-container { flex-direction: column; gap: 30px; }
    .roadmap-sep { display: none; }

    .home-hero { padding: 60px 0 50px; }
    .hero-text h1 { font-size: 2rem; line-height: 1.4; }
    .hero-text p { font-size: 0.95rem; }
    .hero-text br { display: none; }

    .cert-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 30px; }
    .cert-card { padding: 30px 24px; }
    .cert-icon { font-size: 2.4rem; margin-bottom: 10px; }
    .cert-card h3 { font-size: 1.15rem; }

    .section { padding: 60px 0; }
    .section-title { margin-bottom: 30px; }
    .section-title h2 { font-size: 1.6rem; }
    .info-hub { grid-template-columns: 1fr !important; gap: 16px; margin-top: 20px; }
    .info-box { padding: 24px; }

    .footer-content { flex-direction: column; gap: 20px; text-align: center; }
    .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }

    .ad-section { padding: 20px 10px; }
    .carousel-ad { max-width: 100%; overflow: hidden; }
}

/* Coupang Ad Section */
.ad-section {
    padding: 30px 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    overflow-x: auto;
}
.ad-section iframe {
    max-width: 100%;
}
.ad-disclosure {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0.8;
}

/* Enhanced Bulletin Board Styles */
.board-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.board-table th, .board-table td {
    padding: 18px 15px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
}

.board-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.board-table tr:last-child td {
    border-bottom: none;
}

.board-table tr:hover td {
    background: #fdfcfb;
}

.board-table .col-no { width: 80px; }
.board-table .col-title { text-align: left; padding-left: 30px; }
.board-table .col-author { width: 150px; }
.board-table .col-date { width: 120px; }
.board-table .col-views { width: 80px; }

.post-link {
    text-decoration: none;
    color: #2b2d42;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
}

.post-link:hover {
    color: #d4a373;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #e9edc9;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #3b2f2f;
    transition: 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: #fefae0;
    border-color: #d4a373;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-page {
    font-weight: 800;
    color: #bc6c25;
}

/* Post Detail View */
.post-view {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 40px;
}

.post-view-header {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.post-view-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #3b2f2f;
    margin-bottom: 15px;
}

.post-view-meta {
    display: flex;
    gap: 20px;
    color: #8d99ae;
    font-size: 0.95rem;
}

.post-view-meta span b {
    color: #3b2f2f;
    margin-right: 5px;
}

.post-view-content {
    line-height: 1.8;
    color: #2b2d42;
    font-size: 1.1rem;
    white-space: pre-wrap;
    min-height: 300px;
}

.post-view-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.btn-action {
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary { background: #3b2f2f; color: white; }
.btn-primary:hover { background: #d4a373; }
.btn-secondary { background: #f1f3f5; color: #8d99ae; margin-right: 10px; }
.btn-secondary:hover { background: #e9ecef; color: #3b2f2f; }

/* Responsive Board */
@media (max-width: 768px) {
    .board-table .col-author, 
    .board-table .col-date, 
    .board-table .col-views { display: none; }
    .post-view { padding: 25px; }
    .post-view-title { font-size: 1.4rem; }
}

/* Auth Styles */
.login-container {
    max-width: 450px;
    margin: 0 auto;
    background: white;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(59, 47, 47, 0.1);
    text-align: center;
}

.login-container h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-container p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.login-container .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.login-container input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    transition: 0.3s;
}

.login-container input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(212, 163, 115, 0.1);
}

.auth-links {
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
}

/* Kakao AdFit Sidebar Ad (160x600 오른쪽 고정) */
.kakao-sidebar-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

/* Kakao AdFit Middle Ad (300x250 중앙 인라인) */
.kakao-middle-ad {
    display: flex;
    justify-content: center;
    margin: 40px auto;
    width: fit-content;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

/* 컨텐츠 영역과 겹치지 않도록 화면이 충분히 넓을 때만 사이드에 표시 */
@media (max-width: 1400px) {
    .kakao-sidebar-ad {
        position: static;
        transform: none;
        display: flex;
        justify-content: center;
        margin: 30px auto;
        width: fit-content;
    }
}

@media (max-width: 768px) {
    .kakao-sidebar-ad,
    .kakao-middle-ad {
        margin: 20px auto;
        padding: 8px;
        border-radius: 8px;
    }
}
