/* Widget styles inspired by the watercolor art reference */

:root {
    --ink: #5a4a3a;
    --ink-soft: #6f5d4c;
    --ink-light: #8a7a6a;
    --sky-top: #cfe9fb;
    --sky-mid: #e9f7ff;
    --paper: #fff8f0;
    --stroke: #cfe4f3;
    --sun: #f6c46f;
    --shadow: 0 18px 40px rgba(120, 160, 200, 0.28);
}

/* Ensure transparent background for OBS */
html, body {
    margin: 0;
    background: transparent !important;
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    font-family: "UoqMunThenKhung", "Noto Color Emoji", sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    min-height: 100vh;
}

.state-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    width: 100%;
}

.state-card {
    position: relative;
    box-shadow: var(--shadow);
    border: 2px solid var(--stroke);
    border-radius: 28px;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--paper) 55%, var(--paper) 100%);
    padding: 24px 28px;
    width: min(520px, 100%);
    overflow: hidden;
    color: var(--ink);
    text-align: center;
}

.state-card > * {
    position: relative;
    z-index: 1;
}

.state-card::after {
    position: absolute;
    opacity: 0.16;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 2px);
    background-size: 12px 12px;
    pointer-events: none;
    content: "";
}

.state-text {
    margin-top: 12px;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.loader-ring {
    animation: spin 1s linear infinite;
    margin: 0 auto;
    border: 6px solid var(--stroke);
    border-top-color: var(--sun);
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.widget-card {
    position: relative;
    transition: opacity 0.35s ease-in-out;
    box-shadow: none;
    border: 2px var(--ink-soft);
    border-style: dashed;
    border-radius: 5vw;
    background-image: url("../background.webp");
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    aspect-ratio: 800 / 427;
    width: min(500px, 100%);
    overflow: hidden;
}

.widget-layout {
    display: block;
    position: relative;
    z-index: 1;
    padding: 0;
    height: 100%;
}

.location-row {
    display: flex;
    position: absolute;
    top: 6%;
    right: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    height: 26%;
    text-align: center;
}

#place-name {
    margin: 0;
    font-weight: 800;
    font-size: clamp(2.6rem, 7.5vw, 4rem);
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.75);
}

.weather-body {
    display: block;
    position: absolute;
    top: 30%;
    right: 0;
    bottom: 0;
    left: 0;
}

.icon-wrap {
    display: flex;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    padding-left: 8%;
    width: 50%;
    height: 100%;
}

.icon-wrap img {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.12));
    width: clamp(170px, 62%, 260px);
    height: auto;
    object-fit: contain;
}

.temp-block {
    display: flex;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding-top: 4%;
    padding-right: 6%;
    padding-left: 0;
    width: 50%;
    color: var(--ink);
}

.temp-main {
    font-weight: 800;
    font-size: clamp(2.4rem, 6.8vw, 3.7rem);
    line-height: 1;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.description {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 700;
    font-size: clamp(1.2rem, 3.6vw, 1.6rem);
    line-height: 1.2;
}

.temp-range {
    margin: 0;
    color: var(--ink-light);
    font-size: clamp(0.95rem, 2.4vw, 1rem);
    line-height: 1.2;
}

.temp-range span {
    color: var(--ink-soft);
    font-weight: 700;
}

.error-card {
    border-color: #f1c5c5;
    background: linear-gradient(180deg, #ffe7e7 0%, #fff 100%);
    color: #8b3a3a;
}

/* Smooth transitions for cycling */
#weather-display {
    transition: opacity 0.35s ease-in-out;
}

@media (max-width: 560px) {
    .temp-block {
        padding-top: 2%;
    }

    .icon-wrap {
        padding-left: 6%;
    }
}
