/* --- 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: #2c3e50; 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('../images/3330467_m.png') center/cover no-repeat; color: white; 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: rgba(0, 0, 0, 0.3); z-index: -1; }
header h1 {color: #aac5e0; font-size: 55px; text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7); margin-bottom: 5px; padding-left:17px;}
header .subtitle {color: #879db3; font-size: 24px; font-style: italic; text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);}

nav { position: fixed; top: 0; right: 0; background: #34495e; 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; }
.nav-desktop-link { display: none; } /* スマホでは非表示 */

.btn-auth { font-weight: bold; color: #d35400 !important; }
.btn-logout {  font-weight: bold; color: #84baff !important; }
/* ホバー時の挙動 */
.btn-auth:hover,
.btn-logout:hover 

.menu { position: relative; }
.menu:hover .submenu { display: flex; }
.submenu { display: none; position: absolute; top: 100%; right: 0; background: #34495e; flex-direction: column; width: 200px; }
.submenu a { padding: 15px 20px; color: white; text-decoration: none; }
.submenu a:hover { background: #1abc9c; }

/* --- Forms & Buttons  --- */
.form-group { margin-bottom: 15px; }
.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-color 0.3s ease; }
.cta-button:hover { background-color: #e67e22; }
.cta-button:disabled { background-color: #bdc3c7; cursor: not-allowed; }

/* --- Card Design --- */
.card { background-color: #ffffff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); padding: 25px; margin: 20px auto; transition: transform 0.3s ease, box-shadow 0.3s ease; width: 65%; box-sizing: border-box; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); }
.card-container { display: flex; flex-direction: column; gap: 20px; width: 90%; margin: 20px auto; }

/* --- Login Page Styles --- */
.login-card { max-width: 500px; margin: 50px auto; }
.error-message { color: #e74c3c; background-color: #fadbd8; padding: 10px; border-radius: 5px; margin-bottom: 15px; border: 1px solid #e74c3c; text-align: left; }

/* --- Event List Styles --- */
.event-list { list-style: none; padding: 0; text-align: left; }
.event-item { border-bottom: 1px solid #eee; padding: 15px 0; }
.event-item:last-child { border-bottom: none; }
.event-date { color: #e67e22; font-weight: bold; margin-right: 10px; }
.event-title { font-size: 1.1em; font-weight: bold; color: #2c3e50; }
.event-meta { font-size: 0.9em; color: #7f8c8d; margin-top: 5px; }

/* --- Event Page Styles --- */
.event-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-card {
    display: flex; /* 横並びにする */
    align-items: flex-start; /* 上揃え */
    padding: 20px;
    text-align: left; /* 文字は左寄せ */
}

/* カレンダー風日付ボックス */
.calendar-date {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 10px;
    border-radius: 8px;
    min-width: 70px;
    text-align: center;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.cal-month { font-size: 0.9em; font-weight: bold; color: #e67e22; }
.cal-day { font-size: 2.2em; font-weight: bold; line-height: 1; margin: 5px 0; }
.cal-week { font-size: 0.9em; color: #7f8c8d; }

/* イベント詳細エリア */
.event-details {
    flex: 1;
}

.event-name {
    margin: 0 0 10px 0;
    font-size: 1.3em;
    color: #2c3e50;
}

.event-info {
    font-size: 0.95em;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tag-course {
    display: inline-block;
    background-color: #3498db;
    color: white;
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 5px;
}

/* 出欠ステータス */
.attendance-area {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}
.status-ok { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-ng { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-none { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.btn-mini {
    background-color: #34495e;
    color: white;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.3s;
}
.btn-mini:hover { background-color: #2c3e50; }

/* スマホ対応 */
@media (max-width: 600px) {
    .event-card {
        flex-direction: column; /* スマホでは縦並び */
        text-align: center;
    }
    .calendar-date {
        flex-direction: row; /* 日付を横並びに */
        gap: 10px;
        align-items: baseline;
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        box-sizing: border-box;
    }
    .event-info, .attendance-area {
        align-items: center; /* 中央揃え */
    }
}
/* --- Home Page --- */
.highlight { color: #1e90ff; }
.highlight-red { color: red; font-weight: bold; }

/* --- About Page --- */
.highlight-box { background-color: #ffeb3b; padding: 15px; border-radius: 10px; font-size: 20px; font-weight: bold; color: #333; display: inline-block; margin: 10px 0; border: 2px solid #fbc02d; }
.gray-background { background-color: #e0e0e0; padding: 20px; border-radius: 10px; margin-top: 20px; }
.join-section { background-color: #e0f7fa; padding: 20px; border-radius: 10px; margin-top: 20px; text-align: center; }
.join-step { font-size: 1.2em; margin: 15px 0; }
.join-step .step-number { font-size: 1.4em; font-weight: bold; margin-right: 10px; }
.profile { text-align: center; margin-top: 20px; }
.profile img { width: 250px; height: 300px; margin-bottom: 10px; }

/* --- Activity Page --- */
.section-title { font-size: 36px; color: #2c3e50; font-weight: bold; text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2); }
.box-blue { background-color: #CCE5FF; }
.box-orange { background-color: #FFE5CC; }
.box-green { background-color: #CCFFCC; }
.highlight-circle { display: inline-block; padding: 40px; background: #FFFFCC; border-radius: 50%; color: #404040; font-size: 24px; font-weight: bold; }
.social-links a { display: inline-block; margin: 10px; padding: 10px 20px; font-size: 20px; background: #3498db; color: white; text-decoration: none; border-radius: 5px; }

/* --- Q&A Page --- */
.faq-question { font-size: 22px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #2980b9; color: white; padding: 10px; margin-top: 20px; }
.faq-answer { max-height: 0; overflow: hidden; font-size: 18px; padding: 0 10px; background: #CCE5FF; text-align: left; transition: max-height 0.3s ease-out, padding 0.3s ease-out; }
.toggle-btn { background: #1abc9c; color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 3px; font-size: 16px; transition: transform 0.3s ease-in-out; }

/* --- Contact Page --- */
.contact-section { background: #ffffff; padding: 20px; border-radius: 10px; max-width: 1000px; margin: 0 auto; text-align: center; }
.contact-section h3 { font-size: 24px; color: #2c3e50; border-bottom: 2px solid #2c3e50; padding-bottom: 5px; }
.contact-section p { font-size: 18px; color: #333; }
.contact-section a { color: #1abc9c; text-decoration: none; font-weight: bold; }
.faq-list { display: flex; flex-direction: column; align-items: flex-start; margin: 0 auto; line-height: 0.5; width: max-content; }

/* --- Paper (Members) Page --- */
.selector-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 20px; }
.selector, .selector2, .selector3 { padding: 12px 80px; cursor: pointer; font-weight: bold; border-radius: 4px; border: none; font-size: 16px; color: white; }
.selector { background-color: #903a58; }
.selector2 { background-color: #1137b4; }
.selector3 { background-color: #1e9567; }

.month-container { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 20px; }
.month { background-color: #2c3e50; color: white; padding: 12px 90px; cursor: pointer; font-weight: bold; border-radius: 4px; }
.session { background-color: #10c8d5; padding: 12px; margin: 3px auto; max-width: 550px; cursor: pointer; }
.resources { margin: 10px; }
.resources button { padding: 8px 60px; margin: 5px; font-size: 14px; cursor: pointer; border-radius: 4px; border: 1px solid #ccc; background-color: #e6f4c9; }
.resources button:hover { background-color: #e0e0e0; }

/* --- Modal Styles --- */
#viewerModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; }
#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; color: #aaa; cursor: pointer; }
#viewerModal .close:hover { color: #000; }

/* --- BBS (Forum) --- */
.bbs-container { max-width: 800px; margin: 0 auto; text-align: left; }
.bbs-container h1, .bbs-container h2 { border-bottom: 2px solid #34495e; padding-bottom: 10px; margin-top: 40px; }
.thread-list .thread-item { background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 10px; transition: background-color 0.2s; position: relative; }
.thread-list .thread-item a { display: block; padding: 15px; text-decoration: none; color: #2c3e50; }
.thread-list .thread-item:hover { background-color: #eaf1f5; }
.thread-list .thread-item h3 { margin: 0 0 5px 0; }
.thread-list .thread-item p { margin: 0; font-size: 0.9em; color: #7f8c8d; }
.post-list .post-item { margin-top: 20px; }
.post-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 8px; }
.post-date { font-size: 0.9em; color: #7f8c8d; }
.post-body { line-height: 1.6; }
.error { color: #e74c3c; font-weight: bold; }

.delete-form { position: absolute; top: 15px; right: 15px; }
.delete-button { background-color: #e74c3c; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: background-color 0.2s; }
.delete-button:hover { background-color: #c0392b; }

/* --- Responsive --- */
@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 にすると分かりやすい） */
}