/* 管理画面専用スタイル */

.admin-body {
    background-color: #f4f6f8;
    font-family: 'Noto Sans JP', sans-serif;
}

/* 管理者ヘッダー */
.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid #2590ff;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-title a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-title a:hover {
    opacity: 0.9;
}

/* ナビゲーション */
.admin-nav .nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 管理者アクション */
.admin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* メイン */
.admin-main {
    padding: 2rem 0;
    min-height: calc(100vh - 150px);
}

/* ページヘッダー */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.page-subtitle {
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
}

/* ボタンスタイル */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: center;
}

.btn-primary {
    background-color: #2590ff;
    color: white;
}

.btn-primary:hover {
    background-color: #1a73cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 144, 255, 0.3);
}

.btn-outline {
    background: transparent;
    color: #2590ff;
    border: 2px solid #2590ff;
}

.btn-outline:hover {
    background: #2590ff;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* ダッシュボード */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2590ff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
}

.stat-link {
    color: #2590ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.stat-link:hover {
    color: #1a73cc;
}

/* クイックアクション */
.quick-actions, .system-info {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.action-desc {
    font-size: 0.9rem;
    color: #666;
}

/* システム情報 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 500;
}

/* データテーブル */
.content-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.title-cell {
    max-width: 300px;
}

.item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.item-preview {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.4;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.3rem;
}

.photo-cell {
    width: 80px;
}

.participant-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.photo-placeholder-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #999;
}

.type-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-student {
    background: #d4edda;
    color: #155724;
}

.type-companion {
    background: #d1ecf1;
    color: #0c5460;
}

.type-chaperone {
    background: #d4edd5;
    color: #28a745;
}

.content-cell {
    max-width: 200px;
}

.schedule-content {
    font-weight: 500;
}

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

/* フォーム */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #2590ff;
    box-shadow: 0 0 0 3px rgba(37, 144, 255, 0.1);
}

.form-textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.3rem;
}

.html-help {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

.html-help code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

/* 管理者フッター */
.admin-footer {
    background: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .admin-nav .nav-list {
        gap: 0.3rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .stats-grid, .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-nav .nav-list {
        justify-content: center;
    }
    
    .page-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        max-width: 90%;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.8rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* テーブルのレスポンシブ対応 */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th, .data-table td {
        padding: 0.6rem 0.4rem;
    }
    
    .actions-cell .btn {
        margin-right: 0.2rem;
        margin-bottom: 0.2rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .admin-title a {
        font-size: 1.4rem;
    }
    
    .admin-actions {
        justify-content: center;
        width: 100%;
    }
    
    .admin-main {
        padding: 1rem 0;
    }
    
    .stats-grid, .action-grid, .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .empty-state {
        padding: 3rem 1rem;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* 横スクロールテーブル */
    .content-table {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
}

/* 一括削除機能のスタイル */
.bulk-actions {
    margin-bottom: 15px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.bulk-actions label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

.bulk-actions label:hover {
    color: #2590ff;
}

/* チェックボックスのスタイリング */
.item-checkbox, #selectAll, #selectAllInTable {
    transform: scale(1.2);
    margin-right: 5px;
    cursor: pointer;
    accent-color: #2590ff;
}

/* 一括削除ボタン */
#bulkDeleteBtn {
    min-width: 200px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#bulkDeleteBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #6c757d;
    border-color: #6c757d;
}

#bulkDeleteBtn:not(:disabled):hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* 選択数表示 */
#selectedCount {
    font-weight: 700;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* テーブルヘッダーのチェックボックス */
th input[type="checkbox"] {
    transform: scale(1.1);
    cursor: pointer;
}

/* 行のホバー効果とセレクション */
.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 選択された行のハイライト */
.data-table tbody tr:has(.item-checkbox:checked) {
    background-color: #e3f2fd;
    border-left: 4px solid #2590ff;
}

.data-table tbody tr:has(.item-checkbox:checked):hover {
    background-color: #bbdefb;
}

/* チェックボックス列の幅調整 */
.data-table th:first-child,
.data-table td:first-child {
    text-align: center;
    width: 50px;
    min-width: 50px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .bulk-actions label {
        justify-content: center;
    }
    
    #bulkDeleteBtn {
        min-width: auto;
        width: 100%;
    }
}

/* インデターミネート状態のスタイリング */
input[type="checkbox"]:indeterminate {
    background-color: #2590ff;
    border-color: #2590ff;
}

input[type="checkbox"]:indeterminate:before {
    content: '—';
    display: block;
    color: white;
    font-size: 16px;
    text-align: center;
    line-height: 1;
}