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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease;
}

/* 天気に応じた背景色 */
body.sunny {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

body.rainy {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

body.cloudy {
    background: linear-gradient(135deg, #b2bec3, #636e72);
}

body.snowy {
    background: linear-gradient(135deg, #ddd6fe, #a78bfa);
}

body.stormy {
    background: linear-gradient(135deg, #2d3436, #636e72);
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.api-key-section {
    text-align: center;
    margin-bottom: 2rem;
}

.api-key-section h3 {
    color: #2d3436;
    margin-bottom: 1rem;
}

.api-key-section p {
    color: #636e72;
    margin-bottom: 1rem;
}

.api-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

#apiKeyInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#apiKeyInput:focus {
    border-color: #74b9ff;
}

#saveApiKeyBtn {
    padding: 12px 20px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#saveApiKeyBtn:hover {
    background: #00a085;
}

.api-help {
    margin-top: 1rem;
}

.api-help a {
    color: #74b9ff;
    text-decoration: none;
}

.api-help a:hover {
    text-decoration: underline;
}

.api-help small {
    color: #636e72;
    font-size: 0.8rem;
}

.api-key-info {
    text-align: center;
    margin-top: 1rem;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.link-btn {
    background: none;
    border: none;
    color: #74b9ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.link-btn:hover {
    color: #0984e3;
}

.api-key-section {
    text-align: center;
    margin-bottom: 2rem;
}

.api-key-section h3 {
    color: #2d3436;
    margin-bottom: 1rem;
}

.api-key-section p {
    color: #636e72;
    margin-bottom: 1rem;
}

.api-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

#apiKeyInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#apiKeyInput:focus {
    border-color: #74b9ff;
}

#saveApiKeyBtn {
    padding: 12px 20px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#saveApiKeyBtn:hover {
    background: #00a085;
}

.api-help {
    font-size: 0.9rem;
    color: #636e72;
}

.api-help a {
    color: #74b9ff;
    text-decoration: none;
}

.api-help a:hover {
    text-decoration: underline;
}

.api-key-info {
    text-align: center;
    margin-top: 1rem;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.link-btn {
    background: none;
    border: none;
    color: #74b9ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.link-btn:hover {
    color: #0984e3;
}

.api-key-section {
    text-align: center;
    margin-bottom: 2rem;
}

.api-key-section h3 {
    color: #2d3436;
    margin-bottom: 1rem;
}

.api-key-section p {
    color: #636e72;
    margin-bottom: 1rem;
}

.api-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

#apiKeyInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#apiKeyInput:focus {
    border-color: #74b9ff;
}

#saveApiKeyBtn {
    padding: 12px 20px;
    background: #00b894;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#saveApiKeyBtn:hover {
    background: #00a085;
}

.api-help {
    margin-top: 1rem;
}

.api-help a {
    color: #74b9ff;
    text-decoration: none;
}

.api-help a:hover {
    text-decoration: underline;
}

.api-help small {
    color: #636e72;
    font-size: 0.8rem;
}

.api-key-info {
    text-align: center;
    margin-top: 1rem;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.link-btn {
    background: none;
    border: none;
    color: #74b9ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: inherit;
}

.link-btn:hover {
    color: #0984e3;
}

h1 {
    text-align: center;
    color: #2d3436;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

#cityInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#cityInput:focus {
    border-color: #74b9ff;
}

#searchBtn {
    padding: 12px 20px;
    background: #74b9ff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#searchBtn:hover {
    background: #0984e3;
}

.weather-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

#cityName {
    text-align: center;
    color: #2d3436;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1rem;
}

.weather-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-icon {
    font-size: 4rem;
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

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

.weather-temp {
    font-size: 3rem;
    font-weight: bold;
    color: #2d3436;
}

.weather-description {
    text-align: center;
    font-size: 1.2rem;
    color: #636e72;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weather-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.weather-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: bold;
    color: #636e72;
}

.error {
    background: #ff7675;
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1rem;
}

.loading {
    text-align: center;
    color: #636e72;
    font-style: italic;
}

.hidden {
    display: none;
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    .search-section {
        flex-direction: column;
    }
    
    #searchBtn {
        width: 100%;
    }
}