/* 体調記録アプリケーション スタイルシート */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, Meiryo, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* ヘッダー */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #4a90e2;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #4a90e2;
}

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

.username {
    color: #666;
    font-weight: 500;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
}

/* フッター */
.footer {
    background-color: #fff;
    margin-top: 50px;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

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

.disclaimer {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

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

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* アラート */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ログインページ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #4a90e2;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: #f0f0f0;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: #4a90e2;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90e2;
}

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

/* ダッシュボード */
.dashboard h1 {
    margin-bottom: 30px;
    color: #333;
}

.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.today-summary {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.today-summary h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.summary-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.summary-item .label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.recent-records {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recent-records h2 {
    margin-bottom: 20px;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-card {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-date {
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.record-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-mood {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-fatigue {
    background-color: #fff3e0;
    color: #e65100;
}

.badge-warning {
    background-color: #fff9c4;
    color: #f57f17;
}

.badge-danger {
    background-color: #ffebee;
    color: #c62828;
}

/* 記録フォーム */
.record-form-container {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.record-form h1 {
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    margin-bottom: 20px;
    color: #4a90e2;
    font-size: 20px;
}

.warning-section {
    background-color: #fff9e6;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #ffd54f;
}

.warning-section h2 {
    color: #e65100;
}

.warning-text {
    color: #e65100;
    margin-bottom: 20px;
    font-weight: 500;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-label,
.checkbox-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.radio-label:hover,
.checkbox-label:hover {
    background-color: #e3f2fd;
    border-color: #4a90e2;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span,
.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
}

.radio-label:has(input:checked),
.checkbox-label:has(input:checked) {
    background-color: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* グラフページ */
.graph-container {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.period-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-wrapper {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.chart-wrapper h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

/* AI要約ページ */
.summary-container {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.description {
    color: #666;
    margin-bottom: 30px;
}

.summary-form {
    margin-bottom: 40px;
}

.summary-result {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
}

.summary-result h2 {
    margin-bottom: 20px;
}

.summary-text {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    line-height: 1.8;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

.summary-actions {
    display: flex;
    gap: 10px;
}

.past-summaries h2 {
    margin-bottom: 20px;
}

.summary-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.summary-date {
    font-weight: 600;
    color: #4a90e2;
}

.summary-created {
    color: #999;
}

.summary-preview {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: 15px;
    }
    
    .nav.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .charts {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
}

@media print {
    .header,
    .footer,
    .btn,
    .summary-actions,
    .nav {
        display: none !important;
    }
    
    .summary-text {
        border: 1px solid #000;
    }
}
