:root {
    --bg-color: #0c0c0c;
    --text-color: #00ff41;
    --accent-color: #008f11;
    --dim-color: #004400;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Pinotaan elementit päällekkäin */
    align-items: center;    /* Keskelle vaakasuunnassa */
    justify-content: center; /* Keskelle pystysuunnassa */
    padding: 20px;
    box-sizing: border-box;
}

.terminal {
    background-color: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
    padding: 20px;
    width: 95%;          /* Ottaa lähes koko leveyden pienillä laitteilla */
    max-width: 900px;    /* Mutta ei levähdä liian isoksi monitorilla */
    position: relative;
    box-sizing: border-box; /* TÄRKEÄ: Pitää paddingin kehyksen sisäpuolella */
}

/* YLÄVIIVA: Uptime */
.terminal::before {
    content: var(--uptime-text, "UPTIME: LOADING...");
    position: absolute;
    top: -10px;
    left: 20px;
    background-color: var(--bg-color);
    padding: 0 10px;
    font-size: 0.75rem;
    color: var(--accent-color);
    white-space: nowrap;
    z-index: 2;
}

/* ALAVIIVA: Visitors & Time */
.terminal::after {
    content: var(--status-text, "SYSTEM READY");
    position: absolute;
    bottom: -10px; /* Sijoittaa tekstin alaviivan päälle */
    right: 20px;  /* Laitetaan tämä oikeaan reunaan tasapainon vuoksi */
    background-color: var(--bg-color);
    padding: 0 10px;
    font-size: 0.75rem;
    color: var(--accent-color);
    white-space: nowrap;
    z-index: 2;
}

/* Mobiili-hienosäätö: Pienennetään tekstejä entisestään */
@media (max-width: 600px) {
    .terminal::before, .terminal::after {
        font-size: 0.65rem;
        padding: 0 5px;
    }
}

h1 { font-size: 1.5rem; margin-bottom: 20px; }
h2 { font-size: 1.2rem; color: #fff; border-bottom: 1px dashed var(--accent-color); padding-bottom: 5px; margin-top: 30px; }

.prompt { color: #fff; }
.command { color: #5bc0de; }

ul { list-style: none; padding-left: 0; }
li::before { content: "➜ "; color: var(--accent-color); margin-right: 8px; }

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

@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
}

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

a { color: #fff; text-decoration: none; border-bottom: 1px solid var(--accent-color); }
a:hover { background: var(--accent-color); color: var(--bg-color); }

footer { margin-top: 50px; font-size: 0.8rem; color: var(--dim-color); text-align: center; }

.server-address {
    /* Poista position: absolute, top, left ja transform */
    font-size: 0.85rem;
    letter-spacing: 3px;
    color: var(--accent-color);
    opacity: 0.75;
    text-transform: uppercase;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 143, 17, 0.3);
    margin-bottom: 15px; /* Tämä takaa välin terminaaliin */
    text-align: center;
}

.server-address:hover {
    opacity: 1;
    color: var(--text-color);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
    letter-spacing: 4px; /* Pieni dynaaminen efekti hiirellä */
}

/*
@media (max-width: 600px) {
    .terminal {
        padding: 15px;      /* Hieman tiivimpi sisus mobiilissa */
        font-size: 0.9rem;  /* Pienennetään tekstiä, jotta se ei rivity rumasti */
    }

    .terminal::before {
        font-size: 0.65rem; /* Pienennetään yläpalkin tekstiä (kello/laskuri) */
        left: 10px;         /* Siirretään tekstiä lähemmäs reunaa */
        white-space: nowrap;
        overflow: hidden;   /* Varmistaa, ettei teksti riko kehyksiä */
    }

    h1 {
        font-size: 1.2rem;  /* Otsikko pienemmäksi puhelimella */
    }
}
*/

@media (max-width: 600px) {
    .terminal::before {
        font-size: 0.7rem; /* Pienempi fontti mahtuu paremmin */
        top: -9px;         /* Hienosäätö pystysuunnassa */
        left: 10px;
        letter-spacing: 0; /* Poistetaan harvennus, jotta teksti lyhenee */
    }
}

.dashboard-grid {
    display: grid;
    /* Muutetaan 550px -> 100% kapeilla näytöillä */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 20px;
    margin-top: 20px;
}

.graph-card h3 {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(0, 255, 65, 0.3);
    padding-bottom: 5px;
}

.graph-card img {
    filter: brightness(1.1) contrast(1.1);
    transition: opacity 0.3s ease;
}

.graph-card img:hover {
    filter: brightness(1.3); /* Korostuu kun hiiri on päällä */
}
