﻿/* ===== リセット・基本スタイル ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 2000px;
    margin: 0 auto;
}

/* ===== ログイン画面 ===== */
.login-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
}

.login-subtitle {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

/* ===== フォーム ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== ボタン ===== */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #e9ecef;
    color: #495057;
}

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

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-back {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-back:hover {
    background-color: #e0e0e0;
}

.btn-logout {
    padding: 8px 16px;
    background-color: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-logout:hover {
    background-color: #667eea;
    color: white;
}

.btn-view {
    padding: 8px 16px;
    background-color: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-right: 8px;
}

.btn-view.active {
    background-color: #667eea;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #4CAF50;
    color: white;
    margin-right: 4px;
}

.btn-edit:hover {
    background-color: #45a049;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #da190b;
}

/* ===== デモユーザー情報 ===== */
.demo-users {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.demo-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.demo-list {
    list-style: none;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.demo-list li {
    margin-bottom: 12px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* ===== システム管理者リンク ===== */
.system-admin-link {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: center;
}

.system-admin-link p {
    font-size: 13px;
    color: #666;
}

.system-admin-link a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.system-admin-link a:hover {
    text-decoration: underline;
}

/* ===== ナビゲーション ===== */
.navbar {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand h1 {
    font-size: 20px;
    color: #667eea;
    margin: 0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-weight: 500;
    color: #333;
}

/* ===== メインレイアウト ===== */
.main-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background-color: white;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    overflow-y: auto;
}

.menu {
    list-style: none;
}

.menu > ul {
    list-style: none;
    padding: 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
}

.menu-item:hover {
    background-color: #f5f5f5;
    border-left-color: #667eea;
    color: #667eea;
}

/* ===== アコーディオン ===== */
.accordion {
    list-style: none;
}

.accordion-btn {
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    background: none;
    border: none;
    border-left: 4px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-btn:hover {
    background-color: #f5f5f5;
    border-left-color: #667eea;
    color: #667eea;
}

.accordion-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.accordion-btn.active .accordion-icon {
    transform: rotate(-180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #f9f9f9;
    display: none;
}

.accordion-content.show {
    display: block;
    max-height: 500px;
}

.menu-subitem {
    display: block;
    padding: 10px 20px 10px 40px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
}

.menu-subitem:hover {
    color: #667eea;
    background-color: #f5f5f5;
}

/* ===== コンテンツエリア ===== */
.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ===== ダッシュボードヘッダー ===== */
.dashboard-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    font-size: 24px;
    color: #333;
}

.month-info {
    font-size: 16px;
    font-weight: 500;
    color: #667eea;
}

.view-switcher {
    display: flex;
    gap: 8px;
}

/* ===== 詳細ページヘッダー ===== */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.detail-header h2 {
    font-size: 24px;
    color: #333;
}

/* ===== テーブル ===== */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background-color: #f8f9fa;
}

th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
}

td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
}

th:first-child,
td:first-child {
    text-align: left;
}

/* ===== 管理者支援記録テーブル ===== */
.admin-schedule-table {
    background: white;
}

.admin-schedule-table tbody tr:hover {
    background-color: #f9f9f9;
}

.staff-name {
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 2;
}

.staff-link {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
}

.staff-link:hover {
    text-decoration: underline;
}

.day-header {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 4px;
    background-color: #f8f9fa;
}

.day-header.weekend {
    background-color: #fff8f0;
    color: inherit;
}

.day-header.saturday {
    background-color: #e8f4f8;
}

.weekday {
    display: block;
    font-size: 10px;
    color: #999;
    font-weight: normal;
}

.schedule-cell {
    min-height: 50px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
}

.schedule-cell:hover {
    background-color: #e8ecff;
}

.schedule-cell.weekend {
    background-color: #fff8f0;
}

.schedule-cell.weekend:hover {
    background-color: #e8e8e8;
}

.schedule-cell.saturday {
    background-color: #e8f4f8;
}

.schedule-content {
    padding: 4px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

/* ===== スタッフ支援記録テーブル ===== */
.student-schedule-table {
    background: white;
}

.student-header {
    background-color: #e3f2fd !important;
    font-size: 12px;
}

.student-kana {
    display: block;
    font-size: 10px;
    font-weight: normal;
    color: #999;
}

.date-header {
    font-weight: 600;
    background-color: #f8f9fa;
}

.date-header.weekend {
    background-color: #fff8f0;
}

.date-header.saturday {
    background-color: #e8f4f8;
}

/* ===== カレンダー ===== */
.calendar {
    background: white;
    margin-bottom: 20px;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.calendar thead {
    background-color: #f8f9fa;
}

.calendar th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    width: calc(100% / 7);
}

.calendar tbody tr {
    height: 100px;
}

.calendar td {
    position: relative;
    padding: 0;
    border: 1px solid #dee2e6;
    background-color: white;
    width: calc(100% / 7) !important;
}

.calendar td.empty {
    background-color: #f9f9f9;
    cursor: default;
}

.calendar td.weekend {
    background-color: #fff8f0;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    height: 100%;
    width: 100%;
}

.calendar-day:hover {
    background-color: #e8ecff;
}

.day-number {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin: 0;
    position: absolute;
    top: 2px;
    left: 4px;
}

.calendar-day.weekend {
    background-color: #fff8f0;
}

.calendar-day.saturday {
    background-color: #e8f4f8;
}

.schedule-info {
    font-size: 11px;
    color: #666;
    flex: 1;
    overflow: hidden;
}

/* ===== 学生支援記録ビュー ===== */
.student-calendar-view,
.staff-schedule-view {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.calendar-wrapper {
    width: 100%;
    overflow-x: visible;
}

.student-list-sidebar {
    display: none !important;
}

.student-list-sidebar h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #333;
}

.student-mini-list {
    list-style: none;
    font-size: 13px;
}

.student-mini-list li {
    padding: 8px;
    margin-bottom: 6px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.student-mini-name {
    color: #333;
}

/* ===== 詳細コンテナー ===== */
.detail-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.info-item {
    margin-bottom: 15px;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
    font-size: 13px;
}

.info-item p {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* ===== フォーム ===== */
.schedule-detail-form {
    margin-bottom: 30px;
}

.schedule-detail-form h3,
.related-students h3,
.related-staff h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.related-students {
    margin-bottom: 30px;
}

.student-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.student-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.student-info {
    margin-bottom: 10px;
}

.student-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.student-kana {
    font-size: 12px;
    color: #999;
}

.student-note textarea {
    padding: 8px;
    font-size: 12px;
}

/* ===== スタッフ関数/生徒詳細 ===== */
.related-staff {
    margin-top: 30px;
}

.staff-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.staff-card {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.staff-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.staff-role {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

/* ===== 生徒詳細 ===== */
.students-schedule-detail {
    margin-bottom: 30px;
}

.student-detail-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.student-header-detail {
    margin-bottom: 20px;
}

.student-header-detail h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
}

.student-header-detail .student-kana {
    font-size: 13px;
    color: #999;
}

.all-students-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.student-card-detail {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.3s;
}

.student-card-detail:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.student-card-detail a {
    color: #667eea;
    text-decoration: none;
}

.student-card-detail a:hover {
    text-decoration: underline;
}

.schedule-summary {
    font-size: 13px;
    color: #999;
    margin-top: 10px;
}

/* ===== マスタ管理 ===== */
.master-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.master-header h2 {
    font-size: 24px;
    color: #333;
}

.master-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.master-table {
    width: 100%;
    border-collapse: collapse;
}

.master-table thead {
    background-color: #f8f9fa;
}

.master-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.master-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.master-table tbody tr:hover {
    background-color: #f9f9f9;
}

.actions {
    text-align: center;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin {
    background-color: #fff3cd;
    color: #856404;
}

.badge-staff {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ===== モーダル ===== */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
}

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

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-actions {
    gap: 10px;
    margin-top: 25px;
    flex-direction: row-reverse;
}

.modal-content .form-actions button {
    flex: 1;
}

/* ===== フッター ===== */
.footer {
    background-color: white;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 30px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
    }

    .menu-item {
        display: inline-block;
        margin-right: 15px;
    }

    .admin-schedule-table {
        font-size: 12px;
    }

    .admin-schedule-table th,
    .admin-schedule-table td {
        padding: 6px 2px;
    }
}

@media (max-width: 768px) {
    .student-calendar-view {
        flex-direction: column;
    }

    .calendar-wrapper {
        width: 100%;
    }

    .calendar {
        font-size: 12px;
    }

    .calendar tbody tr {
        height: 80px;
    }

    .login-box {
        max-width: 90%;
        padding: 30px 20px;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .master-table {
        font-size: 12px;
    }

    .master-table th,
    .master-table td {
        padding: 8px;
    }

    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .navbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .content {
        padding: 15px;
    }

    .login-box {
        max-width: 100%;
        margin: 10px;
        padding: 20px;
    }

    .calendar-wrapper {
        width: 100%;
        overflow-x: visible;
    }

    .calendar {
        font-size: 10px;
        table-layout: fixed;
    }

    .calendar tbody tr {
        height: 60px;
    }

    .day-header {
        font-size: 10px;
        padding: 4px;
    }
}
/* ===== 支援記録検索・一覧 ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.btn-info {
    background-color: #2196F3;
    color: white;
}

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

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.schedule-table thead {
    background-color: #f5f5f5;
}

.schedule-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.schedule-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.schedule-table tbody tr:hover {
    background-color: #f9f9f9;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
