/* 感情天気予報 - スタイルシート */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --bg-color: #f0f4f8;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.6s ease-out;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* セクション共通スタイル */
section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* 感情入力セクション */
.weather-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.weather-btn {
    background: var(--card-bg);
    border: 2px solid #e1e8ed;
    border-radius: var(--border-radius);
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.weather-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.weather-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    transform: scale(1.05);
}

.weather-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    animation: weatherBounce 2s infinite;
}

.weather-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 天気アイコンアニメーション */
@keyframes weatherBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 晴れのアニメーション */
.weather-btn[data-weather="sunny"]:hover .weather-icon {
    animation: rotateSun 3s linear infinite;
}

@keyframes rotateSun {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 雨のアニメーション */
.weather-btn[data-weather="rainy"]:hover .weather-icon {
    animation: rainDrop 1s ease-in-out infinite;
}

@keyframes rainDrop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* メモ入力エリア */
.emotion-note {
    margin-bottom: 20px;
}

.emotion-note label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

#note {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#note:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 保存ボタン */
.save-btn {
    background: linear-gradient(135deg, var(--primary-color), #3498db);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
}

.save-btn:active {
    transform: translateY(0);
}

/* 天気予報表示 */
.forecast-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

.current-weather, .weather-stats {
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.weather-display {
    margin-top: 20px;
}

.display-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.display-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.display-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* 統計表示 */
.stats-container {
    text-align: left;
}

.stat-item {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.forecast-text {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-style: italic;
}

/* 履歴表示 */
.history-container {
    max-height: 400px;
    overflow-y: auto;
}

.history-day {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.history-day:last-child {
    border-bottom: none;
}

.history-day h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 10px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

.history-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-note {
    cursor: help;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--error-color);
}

/* フッター */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* スクロールバーのスタイル */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}