/* ===== THEME ===== */
:root {
    --bg-main: #0f1a12;
    --bg-card: #18261c;

    --text-main: #ffffff;
    --text-muted: #9aa89c;

    --accent: #81c784;

    --green: #4caf50;
    --yellow: #d4ac0d;
    --blue: #4aa3df;
    --red: #e57373;

    --temp: #ffb74d;
    --rain: #4aa3df;
}

/* ===== BASE ===== */
body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: auto;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #1a1a1a;
    padding: 8px 10px;
    border-radius: 12px;

    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    margin-bottom: 15px;

    /* ✅ optional premium */
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px; /* vähän lisää spacingia */
}

/* ===== MENU ===== */
.menu-container {
    position: relative;
}

#menuBtn {
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
}

.menu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 30px;
    background: #1a2a1f;
    border-radius: 8px;
    padding: 10px;
    min-width: 140px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.menu-dropdown a {
    display: block;
    padding: 8px;
    text-decoration: none;
    color: #ccc;
}

.menu-dropdown a.active {
    color: #00e5ff;
}

.menu-dropdown a:hover {
    background: #2e4233;
}


/* ===== WEATHER ===== */
#weather-icon {
    display: flex;
    align-items: center;
}

.weather-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

#weather-icon img {
    width: 26px;
    height: 26px;
    display: block;
    filter: brightness(1.15); /* näkyy paremmin */
}

.weather-inline span {
    font-size: 16px;
    font-weight: bold;
    color: #ccc;
}

/* animaatiot */
img.sun {
    animation: pulseSun 3s ease-in-out infinite;
}

img.cloud {
    animation: floatCloud 4s ease-in-out infinite;
}

img.rain {
    animation: rainDrop 1.2s ease-in-out infinite;
}

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: clamp(12px, 3vw, 18px);
    margin-bottom: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

/* ===== STATUS ===== */
.status {
    font-size: clamp(20px, 5vw, 28px);
    padding: clamp(12px, 4vw, 20px);
    font-weight: bold;
    text-align: center;
    border-radius: 12px;

    color: #f5f5f5;
    background: var(--bg-card);

    box-shadow: 0 4px 12px rgba(0,0,0,0.5);

    transition: background 0.25s linear, transform 0.15s ease;

    position: relative;
    overflow: hidden;
}

.status::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--green);
    width: var(--progress-width, 0%);
    transition: width 0.2s linear;
    z-index: 0;
}

.status-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status:hover {
    transform: scale(1.03);
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
}

.status:active {
    transform: scale(0.98);
}

.status .main {
    font-size: 20px;
}

.status .sub {
    font-size: 14px;
    opacity: 0.85;
}

.status.running::before {
    background: var(--green);
}

.status.idle::before {
    background: var(--blue);
}

.clickable {
    cursor: pointer;
}

/* ===== HISTORY ===== */
.history {
    font-size: 13px;
    color: var(--text-muted);
    max-height: 200px;
    overflow-y: auto;
}

/* ===== CHART ===== */
.chart-wrapper {
    height: 50vh;
    min-height: 250px;
}

/* ===== LEGEND ===== */
.legend {
    margin-top: 10px;
}

.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.legend-col {
    display: flex;
    flex-direction: column;
}

.legend-col:first-child {
    border-right: 1px solid #333;
    padding-right: 10px;
}

.legend-col:last-child {
    padding-left: 10px;
}

.legend-title {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    font-weight: bold;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ===== POINTS ===== */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
}

.dot.dry { background: var(--green); }
.dot.soon { background: var(--blue); }
.dot.rainnow { background: var(--red); }
.dot.manual { background: #9b59b6; }

/* ===== LINES ===== */
.line {
    width: 20px;
    height: 2px;
    margin-right: 6px;
}

.line.temp { background: var(--temp); }
.line.rain { background: var(--rain); }

/* ===== ANIMATIONS ===== */
@keyframes floatCloud {
    0% { transform: translateX(0px); }
    50% { transform: translateX(5px); }
    100% { transform: translateX(0px); }
}

@keyframes rainDrop {
    0% { transform: translateY(0px); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(0px); }
}

@keyframes pulseSun {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ===== RIGHT SIDE (RUUVI) ===== */
#ruuvi {
    font-size: 13px;
    color: #aaa;
}
