/* ================================================================== */
/* == 사이트 공용 스타일 (main.css) - 최종 수정본 == */
/* ================================================================== */

/* === 공통 스타일 === */
body {
    font-family: 'Noto Sans KR', Arial, sans-serif;
    background: url('/images/desk-feel.png') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #fff;
    padding-top: 70px; /* 고정 헤더를 위한 공간 */
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

/* === 스티키 헤더 === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    height: 70px;
    box-sizing: border-box;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.site-header .logo img { height: 50px; }
.user-info { display: flex; align-items: center; gap: 15px; position: relative; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; }
.user-info a { padding: 8px 15px; background-color: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; border-radius: 10px; font-weight: 500; transition: all 0.2s; border: 1px solid rgba(255, 255, 255, 0.3); }
.user-info a:hover { background-color: rgba(255, 255, 255, 0.25); transform: translateY(-1px); }

/* === index.php 전용 레이아웃 및 컴포넌트 === */
.main-layout { display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: 20px; text-align: left; }
.left-panel { flex: 0 0 320px; }
.right-panel { flex: 1; min-width: 600px; }
.left-panel-content, .right-panel-content { background-color: rgba(0, 0, 0, 0.25); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); border-radius: 10px; padding: 25px; border: 1px solid rgba(0, 0, 0, 0.1); }
.section-title { font-size: 1.4em; color: #fff; margin: 0; padding: 0; border: none; }
.section-title-sub { font-size: 1.4em; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.5); padding-bottom: 10px; margin-top: 0; margin-bottom: 20px; }
.grade-group { margin-bottom: 25px; }
.grade-buttons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade-button { display: flex; justify-content: center; align-items: center; padding: 12px 5px; color: #fff; text-decoration: none; border-radius: 5px; font-size: 1em; font-weight: 500; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); text-align: center; }
.high-button { background-color: #007BFF; } .middle-button { background-color: #28A745; } .elementary-button { background-color: #FFDE59; color: #333; }
.grade-button:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.profile-section { margin-bottom: 30px; }
.profile-section:last-child { margin-bottom: 0; }
.title-with-more-container { border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 10px; margin-bottom: 20px; }
.title-with-more { display: flex; justify-content: space-between; align-items: center; }
.teacher-box { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.teacher-video { flex: 1; min-width: 300px; max-width: 300px; aspect-ratio: 16/9; background-color: #000; border-radius: 5px; overflow:hidden;} .teacher-video iframe { width:100%; height:100%; border:0; }
.teacher-info { flex: 1.5; min-width: 250px; }
.student-list { display: flex; flex-direction: column; gap: 10px; }
.student-item { background-color: rgba(0,0,0,0.2); padding: 10px 15px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.1);}
.sponsor-list-item { display: flex; align-items: center; gap: 15px; background-color: rgba(0,0,0,0.2); padding: 10px 15px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.1); text-decoration: none; color: #fff; transition: background-color 0.2s; }
.sponsor-list-item:hover { background-color: rgba(0,0,0,0.4); }
.sponsor-list-item .logo { width: 80px; height: 40px; object-fit: contain; flex-shrink: 0; }
.sponsor-list-item .details { text-align: left; }
.sponsor-list-item .details .name { font-weight: bold; }
.sponsor-list-item .details .desc { font-size: 0.85em; color: #ccc; margin-top: 2px; }
.problem-grid { display: flex; flex-direction: column; gap: 20px; }
.problem-card-simple { position: relative; background-color: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 25px; display: flex; flex-direction: column; text-align: left; transition: opacity 0.3s, border-left-color 0.3s; border-left: 5px solid transparent; }
.problem-card-simple .meta { font-size: 0.85em; color: #ddd; margin-bottom: 15px; }
.problem-card-simple .question-text { font-size: 1.3em; font-weight: 500; margin: 0 0 10px 0; flex-grow: 1; }
.answer-form { display: flex; gap: 10px; margin-top: 20px; position: relative; /* 자식 absolute 요소의 기준점 */ }
.answer-form input { flex-grow: 1; padding: 10px; border-radius: 4px; border: 2px solid rgba(255,255,255,0.4); background-color: rgba(0,0,0,0.3); color: #f0f0f0; font-size: 1em; }
.answer-form button { padding: 10px 20px; border-radius: 4px; border: none; background-color: #007bff; color: #fff; cursor: pointer; font-weight: 500; }
.solve-btn-simple { display: inline-block; margin-top: 15px; padding: 10px 20px; background-color: #28a745; color: white; text-decoration: none; border-radius: 5px; font-weight: bold; }
.result-message {
    min-height: 24px;
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.result-message.visible {
    visibility: visible;
    opacity: 1;
}
.result-message.correct {
    background-color: rgba(40, 167, 69, 0.8);
    color: #fff;
}
.result-message.incorrect {
    background-color: rgba(220, 53, 69, 0.8);
    color: #fff;
}

/* === 공용 버튼 === */
.nav-btn { padding: 8px 15px; background-color: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; border-radius: 6px; font-weight: 500; border: 1px solid rgba(255, 255, 255, 0.3); transition: all 0.2s; white-space: nowrap; }
.nav-btn:hover { background-color: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }

/* === 햄버거 메뉴 === */
.hamburger-menu { background: none; border: none; color: white; font-size: 28px; cursor: pointer; padding: 0 10px; }
.mega-menu-panel {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 300px;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1001;
    transition: left 0.4s ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.mega-menu-panel.open { left: 0; }
.menu-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 15px; }
.menu-header-title { font-size: 1em; font-weight: 500; color: #ffc107; text-decoration: none; }
.close-menu-btn { background: none; border: none; color: white; font-size: 36px; cursor: pointer; line-height: 1; }
.menu-content { padding-top: 20px; display: flex; flex-direction: column; gap: 25px; }
.menu-category h3 { font-size: 1.2em; color: #ffc107; margin: 0 0 10px 0; border-left: 3px solid #ffc107; padding-left: 10px;}
.menu-category a { display: block; color: #eee; text-decoration: none; padding: 10px 15px; border-radius: 5px; transition: background-color 0.2s, color 0.2s; font-size: 1.05em; font-weight: 500; }
.menu-category a:hover { background-color: rgba(255,255,255,0.1); }
.menu-category a.highlight { background-color: rgba(255, 193, 7, 0.1); color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.3); }
.menu-category a.highlight:hover { background-color: rgba(255, 193, 7, 0.2); }

/* ================================================================== */
/* == 사이트 공용 푸터 스타일 == */
/* ================================================================== */

.site-footer {
    padding: 30px 20px;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-inner-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    font-size: 0.9em;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.support-ukraine {
    font-size: 0.8em;
    color: #bbb;
    opacity: 0.8;
    margin: 0 0 20px 0;
    display: inline-flex;
    align-items: center;
}

.flag-icon {
    width: 20px;
    height: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.copyright {
    font-size: 0.9em;
    color: #ccc;
    margin: 0;
}

/* === 모바일 반응형 === */
.mobile-user-menu { display: none; }
@media (max-width: 768px) {
    .user-info .username, .user-info .desktop-menu { display: none; }
    .user-info img { cursor: pointer; }
    .mobile-user-menu { display: none; position: absolute; top: 55px; right: 0; background-color: rgba(30, 30, 50, 0.9); backdrop-filter: blur(10px); border-radius: 8px; padding: 10px; z-index: 1002; width: 150px; border: 1px solid rgba(255,255,255,0.2); }
    .mobile-user-menu.show { display: block; }
    .mobile-user-menu a { display: block; padding: 10px; text-align: left; border-radius: 5px; }
}
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }
    .left-panel, .right-panel {
        flex-basis: 100%;
        width: 100%;
        min-width: unset;
    }
}