/* ===========================
ページ全体
=========================== */
body {
    margin: 0;
    font-family: "Noto Sans JP", sans-serif;
    background: linear-gradient(295deg, #ffffff 0%, #edf8ff 45%, #d9f2ff 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===========================
カード
=========================== */
.container {
    width: 380px;
    max-width: 90%;
    background: #ffffff;
    padding: 40px;
    border-radius: 28px;
    text-align: center;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, .08);
}

/* ===========================
タイトル
=========================== */
h1 {
    margin-top: 0;
    color: #36536b;
    font-size: 34px;
    margin-bottom: 8px;
}

.sub-title {
    color: #7a8fa2;
    margin-bottom: 35px;
}

/* ===========================
入力欄
=========================== */
input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px;
    font-size: 16px;
    border: none;
    outline: none;
    border-radius: 15px;
    background: #def2ff;
    transition: .3s;
    margin-bottom: 18px;
}

input:focus {
    background: #ecf8ff;
    box-shadow: 0 0 0 2px #969696;
}

/* ===========================
ボタン
=========================== */
button {
    width: 40%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #63c4ff;
    color: white;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: .25s;
}

button:hover {
    background: #47b8ff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(71, 184, 255, .35);
}


/* ===========================
天気表示
=========================== */
#weather {
    margin-top: 35px;
    padding: 25px;
    border-radius: 20px;
    background: #ffffff;
    color: #36536b;
    font-size: 20px;
    line-height: 2;
    min-height: 120px;
    box-shadow: 0 8px 18px rgba(23, 35, 58, 0.15);
    /* border: 3px solid #def2ff; */
}



/* ======================= */
/* 天気ごとの背景変化 */
/* ======================= */
body.sunny {
    background: linear-gradient(180deg, #8fd3ff 0%, #bfe8ff 50%, #ffffff 100%);
}

body.cloudy {
    background: linear-gradient(180deg, #d7dde5 0%, #eef2f5 100%);
}

body.rainy {
    background: linear-gradient(196deg, #7f8994 0%, #619ed3 100%);
}

body.snowy {
    background: linear-gradient(180deg, #ffffff 0%, #dff4ff 100%);
}

/* ======================== */
/* カードの中身 */
/* ======================== */
.location {
    font-size: 18px;
    font-weight: 700;
    color: #355c7d;
    margin-bottom: 20px;
}

.weather-icon {
    font-size: 100px;
    line-height: 1;
}

.weather-text {
    font-size: 24px;
    font-weight: 700;
    color: #355c7d;
    margin-bottom: 15px;
}

.temperature {
    font-size: 48px;
    font-weight: 700;
    color: #464646;
    margin-bottom: 15px;
}

.wind {
    font-size: 18px;
    color: #666;
}

#date {
    margin-top: -5px;
    margin-bottom: 25px;
    color: #7a8da6;
    font-size: 15px;
}

/* ============================= */
/* 天気取得中ロードマップ */
/* ============================= */
.loading {
    width: 50px;
    height: 50px;
    margin: 20px auto;
    border: 5px solid #d6ebff;
    border-top: 5px solid #4db8ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#error-message {
    color: #e53935;
    font-size: 15px;
    font-weight: 500;
    min-height: 22px;
    margin-top: 15px;
}

.weather-icon img {
    width: 130px;
    height: 130px;
    object-fit: contain;
}

/* ===========================
スマホ
=========================== */

@media (max-width: 768px) {

    .container {
        width: 90%;
        max-width: 340px;
        margin: 20px auto;
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
    }

    .weather-icon img {
        width: 90px;
        height: 90px;
    }

    #weather {
        margin-top: 0;
    }

    .temperature {
        font-size: 48px;
    }

    input {
        width: 100%;
    }

    button {
        width: 100%;
    }

    /* ボタンを横並びにする */
    .button-group {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    /* ボタンを小さくする */
    .button-group button {
        width: 35%;
        padding: 12px 0;
        font-size: 12px;
    }
}