/* 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Avenir,
                 Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ヘッダー */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

header nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* メインコンテンツ */
main {
    padding: 2rem 0;
}

h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* メッセージ */
.message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ダッシュボードグリッド */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* バッジ */
.badge {
    display: inline-block;
    padding: .25em .5em;
    border-radius: .25rem;
    font-size: .85rem;
}

.badge-president               { background:#007bff; color:#fff; }   /* 部長 */
.badge-division-head           { background:#28a745; color:#fff; }   /* 分団長 */
.badge-assistant-division-head { background:#17a2b8; color:#fff; }   /* 副分団長 */
.badge-instructor              { background:#6f42c1; color:#fff; }   /* 指導員 */
.badge-treasurer               { background:#fd7e14; color:#fff; }   /* 会計 */
.badge-assistant-treasurer     { background:#e83e8c; color:#fff; }   /* 会計補佐 */
.badge-advisor                 { background:#20c997; color:#fff; }   /* 相談役 */
.badge-member                  { background:#6c757d; color:#fff; }   /* 団員 */

/* スケジュールリスト */
.schedule-list {
    margin-bottom: 1.5rem;
}

.schedule-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.schedule-date {
    min-width: 80px;
    text-align: center;
    font-weight: bold;
    color: #3498db;
}

.schedule-content {
    flex: 1;
}

.schedule-content h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
}

.attendance-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.status-出席 {
    background-color: #d4edda;
    color: #155724;
}

.status-欠席 {
    background-color: #f8d7da;
    color: #721c24;
}

.status-未定 {
    background-color: #fff3cd;
    color: #856404;
}

.status-未回答 {
    background-color: #e2e3e5;
    color: #383d41;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    border: none;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
    margin-top: 1rem;
}

/* ログインフォーム */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

/* フッター */
footer {
    background-color: #ecf0f1;
    padding: 1rem 0;
    text-align: center;
    color: #7f8c8d;
    margin-top: 2rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .schedule-item {
        flex-direction: column;
    }
    
    .schedule-date {
        order: -1;
        margin-bottom: 0.5rem;
    }
    
    header nav {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .login-form {
        margin: 0 15px;
    }
}
/* フォーム関連の追加スタイル */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
}

/* テーブル関連の追加スタイル */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* メッセージタイプの追加 */
.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
/* スケジュール一覧の追加スタイル */
.filter-form {
    margin-bottom: 1rem;
}

.stats-summary {
    background-color: #e3f2fd;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.schedule-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.schedule-header {
    display: flex;
    padding: 1.5rem;
}

.schedule-date-large {
    text-align: center;
    min-width: 80px;
    margin-right: 1.5rem;
    background: #3498db;
    color: white;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
}

/* Past schedule background */
.schedule-date-large.past {
    background: #bdc3c7; /* gray */
    color: #333;
}
}

.schedule-date-large .month {
    font-size: 0.875rem;
    opacity: 0.9;
}

.schedule-date-large .day {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.25rem 0;
}

.schedule-date-large .weekday {
    font-size: 0.875rem;
    opacity: 0.9;
}

.schedule-info {
    flex: 1;
}

.schedule-info h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.schedule-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.schedule-meta i {
    margin-right: 0.25rem;
}

.schedule-actions {
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    text-align: right;
    border-top: 1px solid #eee;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-link,
.pagination-current {
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.pagination-link {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.pagination-link:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.pagination-current {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .schedule-header {
        flex-direction: column;
    }
    
    .schedule-date-large {
        margin-right: 0;
        margin-bottom: 1rem;
        align-self: flex-start;
    }
    
    .filter-form .form-row {
        flex-direction: column;
    }
    
    .filter-form .form-group {
        width: 100%;
    }
}
/* スケジュール詳細の追加スタイル */
.schedule-detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.schedule-main-date {
    text-align: center;
    min-width: 100px;
    background: #3498db;
    color: white;
    border-radius: 8px;
    padding: 1rem 0.5rem;
}

.schedule-main-date .date-month {
    font-size: 1rem;
    opacity: 0.9;
}

.schedule-main-date .date-day {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin: 0.25rem 0;
}

.schedule-main-date .date-weekday {
    font-size: 1rem;
    opacity: 0.9;
}

.schedule-main-info {
    flex: 1;
}

.schedule-main-info h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.schedule-times,
.schedule-creator {
    margin-bottom: 0.5rem;
    color: #666;
}

.schedule-times i,
.schedule-creator i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

.schedule-description-full h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.schedule-description-full p {
    line-height: 1.7;
    white-space: pre-wrap;
}

/* 出欠集計 */
.attendance-summary {
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.summary-item {
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    min-width: 100px;
}

.summary-count {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.summary-label {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 出欠登録フォーム */
.attendance-form {
    text-align: center;
}

.current-status {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.status-options {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-option input[type="radio"] {
    display: none;
}

.status-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.status-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.status-option input[type="radio"]:checked + .status-button {
    border: 2px solid #2c3e50;
    transform: scale(1.05);
}

/* バッジとステータスボタンの色 */
.status-present,
.summary-label.status-present {
    background-color: #d4edda;
    color: #155724;
}

.status-absent,
.summary-label.status-absent {
    background-color: #f8d7da;
    color: #721c24;
}

.status-undecided,
.summary-label.status-undecided {
    background-color: #fff3cd;
    color: #856404;
}

.status-none,
.summary-label.status-none {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.875rem;
}

/* 出欠状況テーブル */
.attendance-table th,
.attendance-table td {
    text-align: center;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
    text-align: left;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .schedule-detail-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .attendance-summary {
        flex-direction: column;
    }
    
    .status-options {
        flex-direction: column;
        align-items: center;
    }
    
    .status-button {
        width: 100%;
        max-width: 200px;
    }
}
/* スケジュール追加フォームの追加スタイル */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.form-actions .btn {
    flex: 1;
    max-width: 200px;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 入力ガイド */
.card ul {
    padding-left: 1.5rem;
}

.card li {
    margin-bottom: 0.5rem;
}

.card li strong {
    color: #2c3e50;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        max-width: none;
    }
}
/* モーダル関連のスタイル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    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: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 1rem;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

#modalScheduleInfo {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

#modalScheduleInfo h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.status-selection-modal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-option-modal {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.status-option-modal input[type="radio"] {
    margin-right: 1rem;
    transform: scale(1.5);
}

.status-button {
    flex: 1;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s;
    cursor: pointer;
}

.status-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-content {
        margin: 20% 5%;
        padding: 1.5rem;
    }
    
    .status-selection-modal {
        flex-direction: column;
    }
    
    .status-option-modal {
        flex-direction: row;
        align-items: center;
    }
}
