/* 高校生・大学生マッチングアプリ CSS */
/* 作成日: 2025年6月21日 */

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

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* メイン */
main {
    padding: 2rem 0;
}

/* セクション */
section {
    background: white;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

section h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

/* 検索フォーム */
.search-form {
    margin-top: 1rem;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.form-group {
    flex: 1;
    min-width: 150px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* ボタン */
.btn-search,
.btn-primary {
    background: #667eea;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-search:hover,
.btn-primary:hover {
    background: #5a6fd8;
}

.btn-reset,
.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-reset:hover,
.btn-secondary:hover {
    background: #5a6268;
}

.btn-post {
    background: #28a745;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    display: inline-block;
    transition: background 0.3s;
}

.btn-post:hover {
    background: #218838;
}

.btn-table {
    background: #6f42c1;
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    display: inline-block;
    transition: background 0.3s;
}

.btn-table:hover {
    background: #5a359a;
}

/* アクションセクション */
.action-section {
    text-align: center;
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* レビューカード */
.review-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
}

.review-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.review-header h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.student-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.student-info span {
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #495057;
}

.university {
    background: #e3f2fd !important;
    color: #1976d2 !important;
}

.department {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
}

.grade {
    background: #e8f5e8 !important;
    color: #388e3c !important;
}

/* 評価表示 */
.review-ratings {
    margin-bottom: 1rem;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.avg-rating {
    font-weight: bold;
    font-size: 1.1rem;
    color: #667eea;
}

.stars {
    color: #ffc107;
    font-size: 1.2rem;
}

.rating-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.rating-label {
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.rating-value {
    color: #667eea;
    font-weight: bold;
    font-size: 1rem;
    margin-left: auto;
}

/* コメント */
.review-comment {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #667eea;
}

.review-comment h4 {
    margin-bottom: 0.5rem;
    color: #555;
}

.review-comment p {
    color: #666;
    line-height: 1.6;
}

/* レビューフッター */
.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.reviewer-info {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reviewer-info span {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #495057;
}

.reviewer-info .nickname {
    background: #fff3cd !important;
    color: #856404 !important;
}

.review-date {
    color: #6c757d;
    font-size: 0.9rem;
}

/* フォームセクション */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafbfc;
}

.form-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.rating-group label:first-child {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.rating-options {
    display: flex;
    gap: 0.5rem;
}

.rating-option {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
    min-width: 50px;
    min-height: 40px;
    width: 50px;
    height: 40px;
    position: relative;
}

.rating-option:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.rating-option input[type="radio"]:checked + span {
    color: white;
    font-weight: normal;
}

/* 選択された評価ボタンのスタイル */
.rating-option.selected {
    background: #667eea;
    border-color: #667eea;
}

.rating-option.selected span {
    color: white;
}

/* 評価ボタンの数字を統一 */
.rating-option span {
    font-weight: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

/* 必須マーク */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* フォームアクション */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* メッセージ */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    text-align: center;
    margin-bottom: 2rem;
}

.success-message h2 {
    color: #155724;
    margin-bottom: 1rem;
}

.error-messages {
    background: #f8d7da;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-bottom: 2rem;
}

.error-messages h3 {
    color: #721c24;
    margin-bottom: 1rem;
}

.error-messages ul {
    margin-left: 1.5rem;
}

.no-results {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.error {
    color: #dc3545;
    text-align: center;
    padding: 1rem;
}

/* フッター */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .rating-options {
        flex-wrap: wrap;
    }
    
    .review-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .student-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rating-details {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 1rem;
    }
    
    .review-card {
        padding: 1rem;
    }
}
