/* ===========================
   OK PÕLVA KOBRAS – MODERN STYLE
   (päises paremal koprapea_small.png; sticky päis FIX)
   =========================== */

/* ========= TEEMA MUUTUJAD ========= */

:root{
    --bg:#f5f7fa;
    --card:#ffffff;
    --text:#1f2933;
    --muted:#6b7280;
    --border:#e5e7eb;

    --accent:#ff9800;
    --accent-dark:#e68900;
    --accent-soft:#fff3e0;

    --row-alt:#f3f4f6;
    --row-hover:#e8f0fe;

    --shadow:0 4px 18px rgba(0,0,0,0.08);
    --radius:10px;
}

html[data-theme="dark"]{
    --bg:#0f172a;
    --card:#1e293b;
    --text:#e2e8f0;
    --muted:#94a3b8;
    --border:#334155;

    --accent:#ff9800;
    --accent-dark:#ffad33;
    --accent-soft:#2d3748;

    --row-alt:#1f2937;
    --row-hover:#334155;

    --shadow:0 4px 18px rgba(0,0,0,0.4);
}


/* ========= ÜLDINE ========= */

body{
    margin:0;
    padding:20px;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    font-size:14px;
    line-height:1.5;
}


/* ========= PÄIS ========= */
/* NB! Sticky katkes, sest .header sees oli kogemata ka "position:relative;"
   mis kirjutas "position:sticky" üle. Siin on see parandatud. */

.header{
    position:sticky;
    top:0;
    z-index:500;

    background:var(--card);
    padding:16px 70px 16px 24px; /* paremale lisaruum logo jaoks */

    font-size:20px;
    font-weight:700;

    box-shadow:var(--shadow);
    border-radius:var(--radius);
    margin-bottom:20px;
}

/* Logo paremale (töötab ka sticky puhul, sest position != static) */
.header::after{
    content:"";
    position:absolute;
    right:18px;
    top:50%;
    transform:translateY(-50%);

    width:38px;
    height:38px;

    background-image:url('koprapea_small.png');
    background-repeat:no-repeat;
    background-size:contain;
    background-position:center;
}

.headerlogo{
    max-height:60px;
    width:auto;
}


/* ========= INFO / BOX ========= */

.box{
    background:var(--accent-soft);
    border-left:4px solid var(--accent);
    padding:12px 16px;
    border-radius:var(--radius);
    margin:10px 0;
}

.info{
    font-weight:600;
    color:var(--accent-dark);
}


/* ========= KLASSI PEALKIRI ========= */

.classheader{
    font-size:22px;
    font-weight:700;
    margin:30px 0 10px 0;
    padding-left:42px;
    background-image:url('kobras_pin.png');
    background-size:28px 28px;
    background-repeat:no-repeat;
    background-position:left center;
}


/* ========= TABELID ========= */

.resulttable{
    width:100%;
    border-collapse:collapse;
    background:var(--card);
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:var(--shadow);
}

.resulttable td{
    padding:8px 10px;
    border-bottom:1px solid var(--border);
    white-space:nowrap;
}

.resultheader{
    background:var(--accent);
    color:#fff;
    font-weight:600;
    font-size:14px;
}

.resultheader td{
    padding:10px;
}


/* ========= REA STIIL ========= */

.r0{
    background:#ffffff;
    font-weight:600;
}

.r1{
    background:var(--row-alt);
    font-weight:600;
}

.s0{
    background:#ffffff;
    font-family:monospace;
}

.s1{
    background:var(--row-alt);
    font-family:monospace;
}

.resulttable tr:hover{
    background:var(--row-hover);
}


/* ========= TIIMID ========= */

.team0{
    background:#ffe0b2;
    font-weight:600;
}

.team1{
    background:#fff3e0;
    font-weight:600;
}


/* ========= LINGID ========= */

a{
    color:var(--accent-dark);
    text-decoration:none;
    font-weight:500;
}

a:hover{
    text-decoration:underline;
}

a.rlink{
    color:#fff;
}


/* ========= KLASSI NAVI (kompaktne, pillid) ========= */

#klassList{
    position:fixed;
    right:12px;
    top:110px;
    z-index:1000;

    background:var(--card);
    padding:10px 10px;
    border-radius:12px;
    box-shadow:var(--shadow);
    border:1px solid var(--border);

    width:444px;
    max-height:72vh;
    overflow:auto;

    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-content:flex-start;

    font-size:12px;
    line-height:1.2;
}

#klassList a{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:3px 8px;
    border-radius:999px;

    border:1px solid var(--border);
    background:var(--accent-soft);
    color:var(--text);

    white-space:nowrap;
    text-decoration:none;
    font-weight:600;
}

#klassList a:hover{
    background:var(--accent);
    border-color:var(--accent);
    color:#fff;
}

#klassList a.active,
#klassList a[aria-current="true"]{
    background:var(--accent);
    border-color:var(--accent);
    color:#fff;
}

/* scrollbari optika (Chrome/Edge/Safari) */
#klassList::-webkit-scrollbar{ width:10px; }
#klassList::-webkit-scrollbar-thumb{
    background:rgba(0,0,0,0.18);
    border-radius:999px;
    border:2px solid transparent;
    background-clip:content-box;
}
html[data-theme="dark"] #klassList::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,0.18);
    border:2px solid transparent;
    background-clip:content-box;
}


/* ========= PRE ========= */

pre{
    font-family:monospace;
    background:var(--card);
    padding:12px;
    border-radius:var(--radius);
    overflow:auto;
}


/* ========= NUPUD ========= */

.btnClass{
    background:var(--accent);
    color:#fff;
    border:none;
    padding:6px 12px;
    border-radius:6px;
    cursor:pointer;
    font-weight:600;
}

.btnClass:hover{
    background:var(--accent-dark);
}


/* ========= RESPONSIVE ========= */

@media (max-width:900px){

    body{
        padding:12px;
    }

    #klassList{
        position:relative;
        right:auto;
        top:auto;
        width:auto;
        max-height:none;
        margin:0 0 16px 0;
    }

    .header{
        font-size:18px;
        padding-right:60px;
    }
}


/* ========= PRINT ========= */

@media print{
    body{
        background:#fff;
        color:#000;
    }

    .header{
        box-shadow:none;
        border:none;
    }

    #klassList,
    .btnClass,
    .noprint{
        display:none !important;
    }

    .resulttable{
        box-shadow:none;
    }
}
