* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* サイトヘッダー */
.site-header {
    background: #2d3748;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    transition: opacity 0.3s;
}

.site-header__link:hover {
    opacity: 0.9;
}

.site-header__logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

body {
    font-family: 'Segoe UI', Meirio, sans-serif;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    min-height: 100vh;
    padding: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.control-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 1rem;
}

.tab-button.active {
    color: #0891b2;
    border-bottom-color: #0891b2;
    font-weight: 700;
}

.tab-button:hover {
    color: #0891b2;
    background: #ecfeff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.add-location {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 日本地図スタイル */
.japan-map {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.region-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 2px solid transparent;
}

.region-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    border-color: #0891b2;
}

.region-card.hokkaido { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.region-card.tohoku { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.region-card.kanto { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.region-card.hokuriku { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }
.region-card.chubu { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.region-card.kinki { background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%); }
.region-card.chugoku { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.region-card.shikoku { background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%); }
.region-card.kyushu { background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%); }
.region-card.okinawa { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); }

.region-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.region-count {
    font-size: 0.9rem;
    color: #666;
}

/* 地点選択モーダル */
.city-modal-overlay {
    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: 10000;
    animation: fadeIn 0.2s ease-out;
}

.city-modal {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease-out;
}

.city-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.city-modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.city-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.city-modal-close:hover {
    color: #333;
    background: #f0f0f0;
    border-radius: 50%;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.city-button {
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #0891b2;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    text-align: center;
    color: #333;
    font-weight: 500;
}

.city-button:hover {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
    transform: translateY(-2px);
}

.city-button.added {
    background: #e9ecef;
    color: #999;
    cursor: not-allowed;
}

.city-button.added:hover {
    transform: none;
    background: #e9ecef;
    color: #999;
    border-color: #e9ecef;
}

select, button {
    padding: 10px 20px;
    border: 2px solid #0891b2;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

select {
    flex: 1;
    min-width: 250px;
    background: white;
    cursor: pointer;
}

button {
    background: #0891b2;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

button:hover {
    background: #0e7490;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.weather-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.location-info h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 5px;
}

.location-details {
    font-size: 0.9rem;
    color: #666;
}

.remove-btn {
    background: #ff6b6b;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #ee5a52;
}

.update-time {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

.forecasts {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.forecast-day {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}

.forecast-day:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.date-label {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1rem;
}

.weather-icon {
    width: 60px;
    height: 45px;
    margin: 10px auto;
}

.telop {
    font-size: 0.95rem;
    color: #333;
    margin: 8px 0;
    font-weight: 500;
}

.temperature {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 8px 0;
    font-size: 1.1rem;
}

.temp-high {
    color: #ff6b6b;
}

.temp-low {
    color: #4dabf7;
}

.rain-chance {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

.description-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.description-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.description-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2rem;
}

.error {
    background: #ffe0e0;
    color: #d32f2f;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1rem;
    opacity: 0.9;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    opacity: 0.8;
}

footer a {
    color: white;
    text-decoration: underline;
}

/* トースト通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

.toast.info {
    border-left: 4px solid #667eea;
}

.toast.success {
    border-left: 4px solid #51cf66;
}

.toast.warning {
    border-left: 4px solid #ffd43b;
}

.toast.error {
    border-left: 4px solid #ff6b6b;
}

/* 確認ダイアログ */
.confirm-overlay {
    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: 10000;
    animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.confirm-message {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.confirm-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-button.cancel {
    background: #e9ecef;
    color: #333;
}

.confirm-button.cancel:hover {
    background: #dee2e6;
}

.confirm-button.confirm {
    background: #ff6b6b;
    color: white;
}

.confirm-button.confirm:hover {
    background: #ee5a52;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .weather-grid {
        grid-template-columns: 1fr;
    }

    .forecasts {
        flex-direction: column;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
    }

    .confirm-dialog {
        width: 85%;
    }
}
