/* style.css - 인성 마스터 완벽 복구 버전 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #f4ece1; color: #333; font-family: 'Pretendard', sans-serif; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.word-wrap-safe { overflow-wrap: break-word; word-wrap: break-word; word-break: keep-all; }

/* =========================================
   1. 상단 메뉴 (절대 안 깨지게 고정)
   ========================================= */
.header { background: #ffffff; border-bottom: 2px solid #004ea2; display: flex; align-items: center; padding: 0 40px; height: 70px; position: sticky; top: 0; width: 100%; z-index: 9999; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.logo { font-size: 22px; font-weight: 900; color: #004ea2; display: flex; align-items: center; gap: 8px; margin-right: 40px; font-family: 'Gowun Batang', serif; }
.nav { height: 100%; flex-grow: 1; }
.nav-links { display: flex; align-items: center; gap: 20px; height: 100%; }
.menu-item { position: relative; font-weight: 700; font-size: 16px; cursor: pointer; height: 100%; display: flex; align-items: center; padding: 0 10px; }
.menu-item:hover { color: #004ea2; }

/* 💡 드롭다운 메뉴 (마우스 올리면 부드럽게 등장) */
.dropdown { display: none; position: absolute; top: 70px; left: 0; background: #fff; border: 1px solid #ddd; border-top: 3px solid #004ea2; min-width: 180px; text-align: left; box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 10000; }
.menu-item:hover .dropdown { display: block !important; }
.dropdown a { display: block; padding: 12px 20px; font-size: 14px; border-bottom: 1px solid #eee; background: white; color: #333; transition: 0.2s; }
.dropdown a:hover { background: #f0f7ff; color: #004ea2; font-weight: bold; padding-left: 25px; } /* 마우스 올리면 살짝 들어가는 효과 */
#user-info-section { margin-left: auto; display: flex; align-items: center; }

/* =========================================
   2. 글 쓰는 부분 (게시판, 포트폴리오, 노트만 예쁘게!)
   ========================================= */
.modal-content input, .modal-content textarea,
.pf-input, .pf-textarea,
.chalk-write-box input, .chalk-write-box textarea,
.note-write-box input, .note-write-box textarea,
.book-write-box input, .book-write-box textarea {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 15px;
    border: 2px solid #e1e4e8;
    border-radius: 10px;
    background-color: #fcfcfc;
    color: #333;
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.modal-content input:focus, .modal-content textarea:focus,
.pf-input:focus, .pf-textarea:focus,
.chalk-write-box input:focus, .chalk-write-box textarea:focus,
.note-write-box input:focus, .note-write-box textarea:focus,
.book-write-box input:focus, .book-write-box textarea:focus {
    background-color: #ffffff;
    border-color: #004ea2;
    box-shadow: 0 0 0 3px rgba(0, 78, 162, 0.15);
    outline: none;
}

/* =========================================
   3. 홈 대시보드 및 성적표
   ========================================= */
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-top: 30px;}
.dashboard-card { background: white; padding: 25px; border-radius: 12px; border: 1px solid #eee; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.dashboard-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.dashboard-card h4 { color: #004ea2; margin-bottom: 15px; font-size: 18px; display: flex; align-items: center; gap: 8px;}
.card-icon { font-size: 1.3em;}

/* 성적표 전용 */
.grade-card { background: white; border-radius: 12px; border: 1px solid #ddd; border-top: 6px solid #004ea2; box-shadow: 0 4px 15px rgba(0,0,0,0.05); max-width: 600px; margin: 40px auto; padding: 30px; }
.grade-sel-group { display: flex; gap: 10px; margin-bottom: 30px; }
.grade-sel { flex: 1; padding: 10px; border: 1px solid #004ea2; border-radius: 5px; font-size: 16px; font-weight: bold; color: #004ea2; outline: none; cursor: pointer; }
.grade-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: bold; font-size: 17px; }
.grade-input { width: 50% !important; padding: 8px !important; border: 1px solid #ccc !important; border-radius: 5px !important; text-align: center !important; font-size: 17px !important; margin-bottom: 0 !important; background: white !important; }

/* =========================================
   4. 게시판, 포트폴리오, 노트 등 기존 기능 유지
   ========================================= */
.study-board-container { width: 98%; max-width: 2000px; margin: 40px auto; padding: 0 10px; }
.study-board { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; align-items: flex-start; scroll-behavior: smooth; width: 100%; flex-wrap: nowrap; }
.study-board::-webkit-scrollbar { height: 12px; }
.study-board::-webkit-scrollbar-track { background: #e9ecef; border-radius: 10px; }
.study-board::-webkit-scrollbar-thumb { background: #adb5bd; border-radius: 10px; }
.subject-col { flex: 0 0 300px; min-width: 300px; background: #ebecf0; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; max-height: 75vh; }
.subject-header { padding: 15px 20px; font-weight: 900; font-size: 18px; color: white; border-radius: 10px 10px 0 0; display: flex; justify-content: space-between; align-items: center; }
.subject-header.kor { background: #ff7675; } .subject-header.math { background: #74b9ff; } .subject-header.eng { background: #55efc4; color: #2d3436; } 
.subject-header.soc { background: #ffeaa7; color: #2d3436; } .subject-header.sci { background: #a29bfe; } .subject-header.etc { background: #b2bec3; } 
.note-list { padding: 15px; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; gap: 12px; }
.study-note-card { background: #ffffff; border-left: 5px solid #004ea2; padding: 15px; border-radius: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.08); position: relative; overflow-wrap: break-word; word-break: keep-all; }

.bookshelf-bg { background: #d4b895; padding: 20px 20px 40px; border-radius: 10px; border: 15px solid #8B4513; max-width: 1000px; margin: 40px auto; min-height: 500px; box-shadow: inset 0 0 20px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 20px; }
.shelf-row { display: flex; gap: 15px; padding: 10px 15px 0; border-bottom: 15px solid #8B4513; min-height: 180px; align-items: flex-end; flex-wrap: wrap; }
.book-spine { width: 45px; height: 150px; flex-shrink: 0; border-radius: 3px 6px 6px 3px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-family: 'Pretendard'; font-size: 15px; cursor: pointer; position: relative; transition: 0.2s; box-shadow: -2px 0 5px rgba(0,0,0,0.2); }
.book-spine:hover { transform: translateY(-10px); }
.book-spine span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 130px; display: inline-block; }
.book-detail-popup { position: absolute; bottom: 170px; left: 50%; transform: translateX(-50%); background: white; color: #333; padding: 15px; border-radius: 8px; width: 280px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); display: none; z-index: 100; text-align: left; border-top: 5px solid #8B4513; }
.book-spine:hover .book-detail-popup { display: block; }
.book-detail-popup::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-width: 10px 10px 0; border-style: solid; border-color: white transparent transparent transparent; }

.portfolio-container { max-width: 1100px; margin: 30px auto; background: white; border-radius: 12px; padding: 30px; display: flex; gap: 30px; border: 1px solid #ddd; border-top: 6px solid #004ea2; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.pf-text-area { flex: 1.8; display: flex; flex-direction: column; gap: 15px; }
.pf-photo-area { flex: 1; text-align: center; min-width: 250px; }
.pf-photo { width: 100%; height: 350px; background: #f8f9fa; border-radius: 12px; border: 3px dashed #004ea2; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 15px; }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; }

.blackboard-bg { background: #11361c; border: 15px solid #8B4513; border-radius: 10px; padding: 40px; color: white; max-width: 1100px; margin: 40px auto; min-height: 800px; position: relative; }
.corkboard-bg { background: #f4ece1; border: 12px solid #d4b895; border-radius: 10px; padding: 40px; max-width: 1100px; margin: 40px auto; min-height: 800px; position: relative; }
#post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-top: 10px; align-items: start; }
.chalk-write-box { background: #1a4225; border: 2px dashed rgba(255, 255, 255, 0.4); border-radius: 10px; padding: 30px 25px 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.btn-chalk { background: transparent; border: 2px solid white; color: white; padding: 10px 25px; border-radius: 20px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.btn-chalk:hover { background: white; color: #11361c; }
.note-write-box { background-color: #fdfae6; border-radius: 5px; padding: 40px 25px 20px 45px; border-left: 3px solid #e74c3c; box-shadow: 2px 4px 15px rgba(0,0,0,0.2); }
.btn-note { background: #ffb347; color: white; border: none; padding: 10px 25px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.post-it-card { position: relative; padding: 35px 20px 20px; border-radius: 2px 2px 10px 10px; box-shadow: 2px 5px 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; color: #333; overflow-wrap: break-word; word-break: keep-all; }
.post-it-card::before { content: ""; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg); width: 70px; height: 28px; background: rgba(255, 255, 255, 0.6); box-shadow: 0 1px 2px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.4); }
.post-it-pink { background-color: #ffd1dc !important; }
.post-it-orange { background-color: #ffe4b5 !important; }
.post-it-blue { background-color: #d1ecf1 !important; }

/* 모달 애니메이션 */
.fab-btn { position: fixed; bottom: 40px; right: 40px; width: 65px; height: 65px; background: #004ea2; color: white; border: none; border-radius: 50%; font-size: 35px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: 0.3s; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 5000; }
.modal-content { position: relative; width: 90%; max-width: 600px; background: white; padding: 30px; border-radius: 15px; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 32px; cursor: pointer; color: #888; font-weight: bold; z-index: 10; }
