/* RainMoney - スタイルシート */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #7BB3E8;
    --accent-color: #2C5AA0;
    --success-color: #4CAF50;
    --background: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --rain-color: rgba(174, 194, 224, 0.5);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 天気背景 */
.weather-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 100%);
    transition: all 0.5s ease;
}

.weather-bg.raining {
    background: linear-gradient(to bottom, #4A5568 0%, #718096 100%);
}

/* 雨のアニメーション */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    background: var(--rain-color);
    width: 2px;
    height: 100px;
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    to {
        transform: translateY(100vh);
    }
}

/* ヘッダー */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

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

/* メインコンテンツ */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 5;
}

/* 天気チェックセクション */
.weather-check {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.location-status, .weather-status {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.location-status .icon, .weather-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.weather-status {
    padding-top: 1rem;
    border-top: 1px solid #E0E0E0;
}

.weather-info {
    flex: 1;
}

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

.location-text {
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* タスクセクション */
.task-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.task-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.task-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.task-card {
    background: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.task-card.completing {
    animation: complete-task 0.5s ease forwards;
}

@keyframes complete-task {
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.task-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.task-reward {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.task-complete-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.task-complete-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

/* 収益表示 */
.earnings {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.earnings h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.earnings-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

/* メッセージボックス */
.no-rain-message, .error-message {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.message-box h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.message-box p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.rain-forecast {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E0E0E0;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #F8F9FA;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* フッター */
footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #E0E0E0;
}

footer nav {
    margin-top: 1rem;
}

footer nav a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

footer nav a:hover {
    color: var(--accent-color);
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    position: relative;
    animation: modal-appear 0.3s ease;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* 完了メッセージ */
.completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 2rem;
    font-weight: 700;
    animation: completion-popup 2s ease forwards;
    z-index: 1001;
}

@keyframes completion-popup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -70%) scale(0.8);
    }
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    main {
        margin: 1rem auto;
    }
    
    .weather-check, .task-section, .message-box {
        padding: 1.5rem;
    }
    
    .earnings-amount {
        font-size: 2rem;
    }
    
    footer nav a {
        display: block;
        margin: 0.5rem 0;
    }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1A202C;
        --card-bg: #2D3748;
        --text-primary: #E2E8F0;
        --text-secondary: #A0AEC0;
    }
    
    .weather-bg {
        opacity: 0.7;
    }
    
    .task-card {
        background: #374151;
        border-color: #4B5563;
    }
    
    .forecast-item {
        background: #374151;
    }
}

/* 言語切替ボタン */
.language-switcher {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.language-switcher button {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.language-switcher button:hover {
    background: rgba(255, 255, 255, 0.5);
}

.language-switcher button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 統計表示 */
.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(74, 144, 226, 0.1);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* エラー時のリトライボタン */
button[data-i18n="retry"] {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

button[data-i18n="retry"]:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}