/* 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #2590ff 0%, #1a73cc 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(37, 144, 255, 0.3);
}

.header-content {
    text-align: center;
}

.site-title a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    display: block;
}

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

.event-date {
    font-size: 1.1rem;
    margin-top: 1rem;
    font-weight: 500;
    opacity: 0.95;
}

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

/* セクション */
.section {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid #2590ff;
    padding-bottom: 0.5rem;
}

.title-icon {
    font-size: 1.5rem;
}

/* お知らせセクション */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.news-item:hover {
    border-color: #2590ff;
    box-shadow: 0 4px 15px rgba(37, 144, 255, 0.1);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.news-date {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    background: #f0f7ff;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid #e0efff;
}

.news-content {
    color: #555;
    line-height: 1.7;
}

/* 行程表セクション */
.schedule-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.schedule-day {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.day-title {
    background: linear-gradient(135deg, #2590ff, #1a73cc);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.schedule-items {
    padding: 1rem 0;
}

.schedule-item {
    display: flex;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item:hover {
    background-color: #f8f9fa;
}

.schedule-time {
    font-weight: 600;
    color: #2590ff;
    min-width: 80px;
    font-size: 0.95rem;
}

.schedule-content {
    flex: 1;
    padding-left: 1.5rem;
}

.schedule-activity {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.3rem;
}

.schedule-location {
    font-size: 0.9rem;
    color: #666;
}

/* 参加者セクション */
.participants-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.team-group {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.team-title {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem 1.5rem;
    background: #fafbfc;
}

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

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

.participant-photo {
    margin-bottom: 1rem;
}

.participant-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.participant-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.3rem;
}

.participant-school {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.participant-grade {
    color: #888;
    font-size: 0.85rem;
}

/* 必要情報セクション */
.information-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.information-item {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.information-item:hover {
    border-color: #2590ff;
    box-shadow: 0 4px 15px rgba(37, 144, 255, 0.1);
}

.information-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.information-content {
    color: #555;
    line-height: 1.7;
}

/* 学生ログインセクション */
.login-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-section .section-title {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.login-info {
    color: rgba(255, 255, 255, 0.95);
}

.login-info p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.login-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.team-login-group h4 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

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

.login-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 管理者リンク */
.admin-link {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
}

.admin-button {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.admin-button:hover {
    background: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* フッター */
.footer {
    background: #333;
    color: #ccc;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.copyright {
    font-size: 0.9rem;
}

/* 空の状態 */
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.2rem;
    }
    
    .login-buttons {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .site-title a {
        font-size: 1.4rem;
    }
    
    .event-date {
        font-size: 1rem;
    }
    
    .section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .news-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    
    .news-date {
        align-self: flex-start;
    }
    
    .schedule-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .schedule-content {
        padding-left: 0;
    }
    
    .participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .team-login-group {
        text-align: center;
    }
    
    .login-buttons {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .login-links {
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .site-title a {
        font-size: 1.2rem;
    }
    
    .main {
        padding: 2rem 0;
    }
    
    .section {
        padding: 1.2rem;
        border-radius: 10px;
    }
    
    .section-title {
        font-size: 1.3rem;
        gap: 0.3rem;
    }
    
    .title-icon {
        font-size: 1.2rem;
    }
    
    .participants-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .participant-card {
        padding: 1.2rem;
    }
    
    .participant-photo img, .photo-placeholder {
        width: 70px;
        height: 70px;
    }
    
    .photo-placeholder {
        font-size: 1.5rem;
    }
}

/* 参加者カテゴリ別スタイル */
.participant-category {
    margin-bottom: 3rem;
}

.category-title {
    color: #2590ff;
    border-bottom: 2px solid #2590ff;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: #fafbfc;
    padding: 1.5rem;
    border-radius: 8px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.participant-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.participant-photo-small img, .photo-placeholder-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.photo-placeholder-small {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #6c757d;
    font-size: 1.2rem;
}

.role-badge {
    background-color: #28a745;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
}

.team-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    background: #e3f2fd;
    color: #1976d2;
}

/* 引率者専用スタイル */
.participant-item[data-type="chaperone"] {
    border-left: 4px solid #28a745;
}

/* 学生個別ページ */
.student-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}

.student-link:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: inherit;
}

.view-detail {
    background: linear-gradient(135deg, #2590ff, #1e7dd8);
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 0 0 10px 10px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s;
}

.participant-card:hover .view-detail {
    opacity: 1;
}

/* プロフィールページ */
.profile-section {
    border-left: 4px solid #2590ff;
    padding-left: 15px;
}

.section-title {
    color: #2590ff;
    font-weight: 600;
    margin-bottom: 10px;
}

.content-box {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    min-height: 60px;
}

.content-box p {
    margin-bottom: 0;
    line-height: 1.6;
}

/* 編集フォーム */
.form-label {
    font-weight: 600;
    color: #333;
}

.form-text {
    color: #666;
    font-size: 0.9em;
}

/* PC用レスポンシブテキストエリア改善 */
.student-edit-textarea {
    min-height: 120px;
    font-size: 14px;
    line-height: 1.5;
    transition: height 0.3s ease;
    resize: vertical;
}

/* PC表示時（768px以上）はより大きく */
@media (min-width: 768px) {
    .student-edit-textarea {
        min-height: 150px;
        font-size: 16px;
        line-height: 1.6;
    }
}

/* デスクトップ表示時（1200px以上）はさらに大きく */
@media (min-width: 1200px) {
    .student-edit-textarea {
        min-height: 180px;
        font-size: 16px;
    }
}

/* 編集セクションデザイン改善 */
.edit-section {
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.edit-section:hover {
    box-shadow: 0 4px 12px rgba(37, 144, 255, 0.15);
    transform: translateY(-2px);
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    flex-shrink: 0;
}

/* テキストエリア改善 */
.enhanced-textarea {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

.enhanced-textarea:focus {
    border-color: #2590ff;
    box-shadow: 0 0 0 0.2rem rgba(37, 144, 255, 0.25);
    background: #ffffff;
}

/* プログレスバー風文字数表示 */
.char-progress {
    width: 100px;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-left: 10px;
}

.char-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

/* 進捗表示改善 */
.progress-items .badge {
    font-size: 0.7em;
    min-width: 50px;
}

/* スティッキーサイドバー調整 */
@media (min-width: 992px) {
    .sticky-top {
        position: sticky;
        top: 20px;
    }
}

/* カードヘッダー改善 */
.card-header.bg-primary {
    background: linear-gradient(135deg, #2590ff 0%, #1976d2 100%) !important;
}

/* ボタン改善 */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary.btn-lg {
    background: linear-gradient(135deg, #2590ff 0%, #1976d2 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(37, 144, 255, 0.3);
}

.btn-primary.btn-lg:hover {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    box-shadow: 0 6px 20px rgba(37, 144, 255, 0.4);
    transform: translateY(-1px);
}

/* フォーム改善 */
.form-text.d-flex {
    align-items: center;
    margin-top: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .participants-list {
        flex-direction: column;
    }
    
    .participant-item {
        width: 100%;
    }
    
    .student-photo {
        width: 120px !important;
        height: 120px !important;
    }
    
    .profile-section {
        margin-bottom: 20px !important;
    }
    
    .edit-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .section-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .char-progress {
        width: 80px;
    }
    
    .d-flex.gap-3.justify-content-between {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .btn-lg {
        width: 100%;
    }
}

/* 非常に小さな画面 */
@media (max-width: 480px) {
    .container-lg {
        padding: 0 10px;
    }
    
    .card-body.p-4 {
        padding: 1.5rem !important;
    }
    
    .edit-section {
        padding: 0.75rem;
    }
}

/* ========================================
   ナビゲーションメニュー
======================================== */

/* Stickyナビゲーション */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #2590ff 0%, #1e7dd8 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.sticky-nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ナビゲーションメニュー */
.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-item {
    flex: 1;
    max-width: 250px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    gap: 5px;
}

.nav-link i {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.nav-link span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ホバー効果 */
.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-link:hover i {
    transform: translateY(-3px);
}

/* アクティブ状態 */
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-bottom-color: #ffffff;
    font-weight: 600;
}

/* セクション */
.content-section {
    padding: 60px 0;
    min-height: 400px;
    scroll-margin-top: 80px; /* ナビゲーション高さ分の余白 */
}

/* セクションタイトル改善 */
.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2590ff;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* スクロールバーのスタイリング */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2590ff;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e7dd8;
}

/* ナビゲーション用レスポンシブ対応 */
@media (max-width: 768px) {
    .nav-link {
        padding: 12px 10px;
        flex-direction: row;
        gap: 8px;
    }

    .nav-link i {
        font-size: 1.2rem;
    }

    .nav-link span {
        font-size: 0.8rem;
    }

    .content-section {
        scroll-margin-top: 70px;
    }
}

@media (max-width: 576px) {
    .nav-menu {
        gap: 0;
    }

    .nav-link {
        padding: 10px 5px;
    }

    .nav-link span {
        display: none; /* スマホではアイコンのみ */
    }

    .nav-link i {
        font-size: 1.5rem;
    }

    .content-section {
        scroll-margin-top: 60px;
    }
}