/* Root container */
.tw-root {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 10px;
    font-family: system-ui, sans-serif;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Themes */
.tw-theme-dark {
    background: linear-gradient(135deg, #141e30, #243b55);
    color: #f5f5f5;
}

.tw-theme-light {
    background: linear-gradient(135deg, #e0f7ff, #ffffff);
    color: #222;
}

/* Header */
.tw-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.tw-location {
    font-size: 0.9rem;
    opacity: 0.9;
}

.tw-temp {
    font-size: 1.8rem;
    font-weight: 600;
}

/* Main area */
.tw-main {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
}

.tw-icon-wrap {
    width: 80px;
    height: 80px;
    position: relative;
}

.tw-meta {
    flex: 1;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Config buttons */
.tw-config {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.tw-config button {
    flex: 1 1 auto;
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
}

.tw-theme-light .tw-config button {
    background: rgba(0, 0, 0, 0.06);
}

.tw-config button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Config dump */
.tw-config-dump {
    margin: 4px 0 0 0;
    padding: 4px;
    border-radius: 6px;
    font-size: 0.65rem;
    max-height: 60px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.25);
    color: #f2f2f2;
}

.tw-theme-light .tw-config-dump {
    background: rgba(0, 0, 0, 0.05);
    color: #111;
}

/* === Animated icons === */

/* SUN */
.tw-icon-sun {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 10px;
}

.tw-icon-sun-core {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fffbe8, #ffd54f);
    box-shadow: 0 0 12px rgba(255, 211, 83, 0.8);
    animation: tw-pulse 2s infinite ease-in-out;
}

.tw-icon-sun-rays {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(255, 243, 170, 0.7);
    box-sizing: border-box;
    animation: tw-rotate 10s linear infinite;
}

/* CLOUD */
.tw-icon-cloud {
    position: relative;
    width: 70px;
    height: 40px;
    margin: 20px 5px;
}

.tw-icon-cloud-main,
.tw-icon-cloud-small {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.tw-icon-cloud-main {
    width: 50px;
    height: 30px;
    left: 10px;
    top: 10px;
}

.tw-icon-cloud-small {
    width: 30px;
    height: 25px;
    left: 0;
    top: 15px;
}

/* RAIN */
.tw-icon-rain {
    position: relative;
    width: 70px;
    height: 60px;
    margin: 10px 5px;
}

/* reuse cloud on top */
.tw-icon-rain-cloud {
    position: absolute;
    left: 0;
    top: 0;
}

.tw-icon-rain-drop {
    position: absolute;
    width: 4px;
    height: 10px;
    border-radius: 999px;
    background: #8fd3ff;
    bottom: 4px;
    left: 14px;
    animation: tw-raindrop 0.8s infinite ease-in;
}

.tw-icon-rain-drop:nth-child(2) {
    left: 30px;
    animation-delay: 0.2s;
}

.tw-icon-rain-drop:nth-child(3) {
    left: 46px;
    animation-delay: 0.4s;
}

/* Keyframes */
@keyframes tw-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

@keyframes tw-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes tw-raindrop {
    0% { transform: translateY(0); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}
