/* --- Global Styles --- */
body { font-family: 'Roboto', 'Noto Sans JP', sans-serif; margin: 0; padding: 0; background-color: #f4f4f4; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 80px 20px 20px; text-align: center; }
footer { background: rgb(64, 128, 128); color: white; text-align: center; padding: 15px; margin-top: auto; width: 100%; }

h1, h2, h3, h4, h5, h6 { font-family: 'Noto Sans JP', sans-serif; }

/* --- Header & Navigation --- */
header { 
    background: url('../3330467_m.png') center/cover no-repeat; 
    color: rgb(0, 64, 128); 
    padding: 80px 20px; 
    text-align: left; 
    font-size: 32px; 
    position: relative; 
    z-index: 1; 
}

/* ヘッダー画像の上の黒い半透明フィルター */
header::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background-color: rgb(0, 64, 128);
    z-index: -1; 
}

/* タイトル文字 */
header h1 {
    color: rgb(206, 254, 107); 
    font-size: 55px; 
    text-shadow: 2px 2px 5px rgb(140, 255, 140); 
    margin-bottom: 5px; 
    padding-left: 35px;
}

/* サブタイトル文字 */
header .subtitle {
    color: rgb(255, 255, 117); 
    font-size: 24px;  
    text-shadow: 1px 1px 3px rgb(254, 245, 139);
	padding-left: 45px;
}


/* ==================================================
   ナビゲーションバー (上の固定メニュー)
   ================================================== */
nav { 
    position: fixed; 
    top: 0; 
    right: 0; 
    background: rgb(64, 128, 128); 
    padding: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
    box-sizing: border-box; 
    z-index: 2; 
    gap: 20px; 
}

.nav-left, .nav-right { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.nav-right { margin-right: 20px; }
.nav-left { margin-left: 20px; }

/* リンクボタンの共通デザイン */
nav a, .menu > a { 
    font-size: 18px; 
    padding: 8px 15px; 
    color: white; 
    text-decoration: none; 
    display: block; 
    border-radius: 5px; 
    transition: background-color 0.3s; 
}

/* ホバー時の色変化 */
.nav-left a:hover { background-color: #3498db; }
.nav-right a:hover { background-color: #4dd4A0; }

/* PC用リンクの表示制御（スマホでは消す用） */
.nav-desktop-link { display: none; } 


/* PC用の教材ドロップダウン */
.nav-dropdown {
    display: none;
    position: relative;
}

.nav-dropdown-trigger {
    font-size: 18px;
    padding: 8px 15px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    display: block;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: rgb(64, 0, 0);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    z-index: 10;
}

.nav-dropdown-content a {
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.nav-dropdown-content a:hover { background-color: #34495e; }
.nav-dropdown:hover .nav-dropdown-content { display: block; }
.nav-dropdown:hover .nav-dropdown-trigger { background-color: #3498db; }

/* 教材メニューがホバー前から飛び出て見えないようにする */
.nav-dropdown:not(:hover) .nav-dropdown-content {
    display: none !important;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown:focus-within .nav-dropdown-content {
    display: block !important;
}

/* ログイン・ログアウトボタンの特別色 */
.btn-auth { font-weight: bold; color: #d35400 !important; }
.btn-logout { font-weight: bold; color: #84baff !important; }


/* ==================================================
   スマホ用メニュー (ハンバーガー・ドロップダウン)
   ================================================== */
.menu { position: relative; }

/* ホバーでメニューを表示 */
.menu:hover .submenu { display: flex; }

/* ドロップダウンの中身 */
.submenu { 
    display: none; 
    position: absolute; 
    top: 100%; 
    right: -20px; 
    background:  rgb(64, 128, 128); 
    flex-direction: column; 
    width: 200px; 
}

.submenu a { 
    padding: 15px 20px; 
    color: white; 
    text-decoration: none; 
}

.submenu a:hover { background: #34495e; }

/* ドロップダウンが消えないようにするための透明な壁 */
.submenu::before {
    content: "";
    display: block;
    position: absolute;
    top: -20px; 
    left: 0;
    width: 100%;
    height: 20px; 
    background: transparent; 
}


/* ==================================================
   レスポンシブ (PC画面幅での表示切り替え)
   ================================================== */
@media (min-width: 768px) {
    /* PC画面ではハンバーガーメニューを消す */
    .menu { display: none; }
    
    /* PC画面では横並びリンクを表示する */
    .nav-desktop-link { display: block; }
       .nav-dropdown { display: block; }
}

/* ==================================================
   3. マイページ・ダッシュボード
   ================================================== */
.dashboard-container {
    max-width: 1000px; margin: 0 auto; padding: 20px;
}

/* プロフィールカード */
.profile-card {
    background: white; border-radius: 15px; padding: 30px; margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-left: 10px solid #34495e; text-align: left;
}
.profile-name { font-size: 1.8em; font-weight: bold; color: #2c3e50; margin-bottom: 10px; }
.profile-detail { color: #7f8c8d; font-size: 1.1em; margin-bottom: 5px; }
.tag-role { background-color: #e74c3c; color: white; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; vertical-align: middle; }

/* メニューグリッド */
.menu-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-top: 20px; }

/* 機能カードボタン */
.menu-card {
    background: white; width: 220px; padding: 30px 10px; border-radius: 10px;
    text-align: center; text-decoration: none; color: #333;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.2s, box-shadow 0.2s;
    border-top: 5px solid #1a237e; display: flex; flex-direction: column; align-items: center; height: 100%;
}
.menu-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.2); background-color: #f9f9f9; }
.card-icon { font-size: 3em; margin-bottom: 10px; display: block; }
.card-title { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; display: block; }
.card-desc { font-size: 0.8em; color: #666; }

/* カード色定義 */
.color-blue { border-top-color: #3498db; } .color-blue .card-icon { color: #3498db; }
.color-purple { border-top-color: #9b59b6; } .color-purple .card-icon { color: #9b59b6; }
.color-green { border-top-color: #2ecc71; } .color-green .card-icon { color: #2ecc71; }
.color-red { border-top-color: #e74c3c; background-color: #fff5f5; } .color-red .card-icon { color: #e74c3c; }
.color-dark { border-top-color: #34495e; } .color-dark .card-icon { color: #34495e; }

/* ==================================================
   4. フォーム・ボタン (style.cssから移植)
   ================================================== */
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-group input[type="text"], .form-group input[type="email"],
.form-group input[type="password"], .form-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ccc;
    border-radius: 5px; box-sizing: border-box;
}
.cta-button {
    display: inline-block; background-color: #f39c12; color: white;
    padding: 12px 25px; border: none; border-radius: 25px;
    text-decoration: none; font-weight: bold; cursor: pointer;
    transition: background 0.3s ease;
}
.cta-button:hover { background-color: #e67e22; }

/* ==================================================
   5. イベント・掲示板・モーダル (style.cssから移植)
   ================================================== */
/* イベント */
.event-card { display: flex; align-items: flex-start; padding: 20px; text-align: left; border-bottom: 1px solid #eee; }
.calendar-date {
    background-color: #ecf0f1; color: #2c3e50; padding: 10px;
    border-radius: 8px; min-width: 70px; text-align: center; margin-right: 20px;
}
.cal-day { font-size: 2.2em; font-weight: bold; line-height: 1; margin: 5px 0; }
.event-name { margin: 0 0 10px 0; font-size: 1.3em; color: #2c3e50; }
.status-badge { padding: 4px 10px; border-radius: 15px; font-weight: bold; font-size: 0.9em; }
.status-ok { background-color: #d4edda; color: #155724; }
.status-ng { background-color: #f8d7da; color: #721c24; }
.status-none { background-color: #fff3cd; color: #856404; }

/* 掲示板 */
.bbs-container { max-width: 800px; margin: 0 auto; text-align: left; }
.thread-list .thread-item {
    background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 8px;
    margin-bottom: 10px; padding: 15px;
}
.thread-list .thread-item a { text-decoration: none; color: #2c3e50; display: block; }

.topic-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; transition: background 0.2s; }
.topic-item:hover { background-color: #f9f9f9; }
.topic-cat { font-size: 0.8em; padding: 3px 8px; border-radius: 4px; color: white; margin-right: 10px; }
.cat-study { background-color: #3498db; } /* 青: 学習 */
.cat-game { background-color: #e67e22; }  /* オレンジ: ゲーム */
.cat-other { background-color: #95a5a6; } /* グレー: その他 */
.comment-badge { background: #eee; color: #555; padding: 2px 8px; border-radius: 10px; font-size: 0.8em; }

/* モーダル */
#viewerModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 2000; }
#viewerModal .modal-content { background: white; margin: 5% auto; padding: 20px; width: 80%; position: relative; max-width: 1000px; }
#viewerModal .close { position: absolute; top: 10px; right: 25px; font-size: 30px; font-weight: bold; cursor: pointer; }

/* プロフィールページ専用スタイル */
.info-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.info-table th { width: 30%; text-align: left; padding: 12px; color: #7f8c8d; border-bottom: 1px solid #eee; font-weight: normal; }
.info-table td { width: 70%; padding: 12px; color: #2c3e50; border-bottom: 1px solid #eee; font-weight: bold; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }

.section-header { font-size: 1.2em; border-left: 5px solid #1a237e; padding-left: 10px; margin-bottom: 15px; color: #1a237e; font-weight: bold; }
       
       /* ペナルティテーブル */
.penalty-table { width: 100%; border: 1px solid #ddd; border-collapse: collapse; margin-top: 10px; }
.penalty-table th { background: #f8d7da; color: #721c24; padding: 10px; text-align: left; }
.penalty-table td { padding: 10px; border-bottom: 1px solid #ddd; }
       
/* アラートメッセージ */
.alert { padding: 15px; margin-bottom: 20px; border-radius: 5px; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
       
/* モーダル */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: white; margin: 10% auto; padding: 25px; border-radius: 10px; width: 400px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.close-btn { float: right; font-size: 24px; cursor: pointer; color: #aaa; }
/*イベント*/
.attendance-form { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #ccc; }
.attendance-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
select { padding: 8px; border-radius: 4px; border: 1px solid #ddd; width: 100px; }
input[type="text"] { flex: 1; padding: 8px; border-radius: 4px; border: 1px solid #ddd; }
.btn-update { background-color: #3498db; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-update:hover { background-color: #2980b9; }

.status-tag { padding: 3px 8px; border-radius: 10px; font-size: 0.8em; color: white; display: inline-block; margin-bottom: 5px; }
.bg-ok { background-color: #2ecc71; } /* 出席 */
.bg-ng { background-color: #e74c3c; } /* 欠席 */
.bg-warn { background-color: #f1c40f; color: #333;} /* 遅刻・未定 */
.bg-none { background-color: #95a5a6; } /* 未回答 */

/*資料ページ*/
.material-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border-bottom: 1px solid #eee; transition: background 0.2s;
}
.material-item:hover { background-color: #f9f9f9; }
.mat-icon { font-size: 2em; margin-right: 15px; color: #3498db; }
.mat-info { flex: 1; text-align: left; }
.mat-title { font-weight: bold; font-size: 1.1em; color: #2c3e50; text-decoration: none; }
.mat-title:hover { text-decoration: underline; color: #2980b9; }
.mat-meta { font-size: 0.85em; color: #7f8c8d; margin-top: 5px; }
.btn-dl { 
    background-color: #3498db; color: white; padding: 8px 15px; 
    border-radius: 20px; text-decoration: none; font-size: 0.9em; 
}
.btn-dl:hover { background-color: #2980b9; }
.tag-course { background:#95a5a6; color:white; padding:2px 6px; border-radius:4px; font-size:0.7em; margin-left: 5px;}

/*過去問ページ*/
.exam-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border-bottom: 1px solid #eee; transition: background 0.2s;
}
.exam-item:hover { background-color: #f9f9f9; }
.exam-icon { font-size: 2em; margin-right: 15px; color: #e74c3c; } /* 赤色に変更 */
.exam-info { flex: 1; text-align: left; }
.exam-title { font-weight: bold; font-size: 1.1em; color: #2c3e50; text-decoration: none; }
.exam-title:hover { text-decoration: underline; color: #c0392b; }
.exam-meta { font-size: 0.85em; color: #7f8c8d; margin-top: 5px; }
.btn-dl { 
    background-color: #e74c3c; color: white; padding: 8px 15px; /* 赤色に変更 */
    border-radius: 20px; text-decoration: none; font-size: 0.9em; 
}
.btn-dl:hover { background-color: #c0392b; }
.tag-subject { background:#2ecc71; color:white; padding:2px 6px; border-radius:4px; font-size:0.8em; margin-right: 5px;}
.tag-type { background:#95a5a6; color:white; padding:2px 6px; border-radius:4px; font-size:0.7em;}
/* ==================================================
   6. スマホ対応 (レスポンシブ)
   ================================================== */
   @media (min-width: 768px) {
       .menu { display: none; }
       .nav-desktop-link { display: block; }
   	.login-card {width: 50% !important; max-width: 1000px;}
       .card-container {flex-direction: row; justify-content: center; gap: 3%; width: 100%; }
       .card-container .card {width: 31%; margin: 0;}
   }
   /* ▼▼▼ ドロップダウンメニューの隙間落ち防止 ▼▼▼ */
   .submenu::before {
       content: "";
       display: block;
       position: absolute;
       /* メニュー本体の少し上から透明な壁を作る */
       top: -20px; 
       left: 0;
       width: 100%;
       height: 20px; /* 隙間を埋める高さ */
       background: transparent; /* 透明にする（デバッグ時は red にすると分かりやすい） */
   }

/* --- Moved from JSP inline <style> blocks --- */
.vote-card { margin-bottom: 20px; border-left: 5px solid #8e44ad; transition: 0.3s; }
.vote-card:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 15px 0; background: #f8f9fa; padding: 10px; border-radius: 5px; }
.stat-item { text-align: center; }
.stat-label { font-size: 0.8em; color: #666; display: block; }
.stat-value { font-size: 1.2em; font-weight: bold; color: #8e44ad; }
.detail-area { display: none; margin-top: 15px; padding-top: 15px; border-top: 1px dashed #ccc; }
.comment-box { background: white; padding: 10px; border-radius: 5px; margin-bottom: 10px; border: 1px solid #eee; font-size: 0.9em; }
.btn-toggle { background: #8e44ad; color: white; border: none; padding: 5px 15px; border-radius: 20px; cursor: pointer; font-size: 0.85em; }

.ans-history { font-size: 0.85em; background: #f0f0f0; padding: 5px 10px; margin-top: 5px; border-radius: 4px; }
.ans-link { text-decoration: none; color: #2980b9; font-weight: bold; }
.ans-link:hover { text-decoration: underline; }

.highlight-title { font-weight: bold; font-size: 1.2em; color: #2980b9; margin-bottom: 10px; display: block; }
.circle-area { text-align: center; background: #fff3cd; padding: 30px; border-radius: 10px; margin-top: 40px; }
.social-btn { display: inline-block; padding: 10px 20px; margin: 5px; border-radius: 5px; color: white; text-decoration: none; font-weight: bold; }
.btn-line { background-color: #06c755; }
.btn-tw { background-color: #1da1f2; }
.btn-inst { background-color: #e1306c; }
.course-tag { font-size: 0.75em; background: #eee; padding: 2px 6px; border-radius: 3px; color: #666; margin-left: 5px; vertical-align: middle; }

