* {
    font-family: "Varela Round", sans-serif;
}

:root {
    --primary: #4f46e5;
    --dark-navy: #0f172a;
    --text-main: #0f172a;
    --text-muted: #515e70;
    --white: #ffffff;
    --bg: #f8fafc;
    --header-h: 80px;
    --donate-bg: #0f172a;
    --donate-text: #ffffff;
    --sidebar-text: #515e70;
    

}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text-main);
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    --bg: #020617;
    --white: #0f172a;
    --text-main: #f8fafc;
    --donate-bg: #f8fafc;
    --donate-text: #020617;
    --sidebar-text: #cbd5e1;
    background-color: var(--bg);
    --basic-text: #f0f0f0;
}

.basic-text {
    color: var(--basic-text);
}

header {
    height: var(--header-h);
    background: var(--white);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 0 0 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
    display: inline-block; /* Dodano za bolju animaciju */
    transition: color 0.3s ease;
}



.logo-container {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -1.2px;
    text-transform: lowercase;
}

.logo-dot {
    color: var(--primary);
}



.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}




.user-container {
    position: relative;
    margin: 0 30px 0 30px;
}

.user-icon-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    
    /* Umjesto border: 3px solid #e2e8f0; koristimo ovo: */
    outline: 3px solid #e2e8f0;
    outline-offset: -1px; /* Ovo gura border 1px PREMA UNUTRA da prekrije prazninu */
    border: none;         /* Makni stari border ako postoji */
    
    padding: 0;
    object-fit: cover;
    background: white;
    display: block;
    transition: all 0.2s ease;
}

.user-icon-img:hover {
    outline-color: var(--primary);
    transform: scale(1.05);
}



.dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--white);
    width: 220px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.dropdown.active {
    display: flex !important;
}

.dropdown-item {
    padding: 16px 24px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary);
}



.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(16px);
}



.hero {
    padding: 120px 20px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(40px, 8vw, 64px);
    font-weight: 800;
    letter-spacing: -3px;
    margin-bottom: 25px;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 18px 35px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
}



.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: var(--white);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    transition: 0.4s ease;
    z-index: 1100;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-menu {
    list-style: none;
    padding: 30px 20px;
    margin: 0;
}

/* Osnovni stil za <li> element u sidebaru */
.sidebar-menu li {
    position: relative;
    display: flex;
    align-items: center;
    padding: 18px 24px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--sidebar-text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
    /* Uklanja defaultne točke liste */
}

/* Smooth hover efekt s prije pseudo-elementom za pozadinsku animaciju */

.sidebar-menu li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

/* Smooth hover efekt na cijeli <li> */
.sidebar-menu li:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-menu li:hover::before {
    width: 100%;
}

.sidebar-menu li:hover::after {
    opacity: 1;
    right: 20px;
}

/* Separator između grupa predmeta */
.menu-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 20px 0;
    opacity: 0.5;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 1050;
}

.overlay.active {
    display: block;
}

/* Efekt bljeskanja za Prijavi se */
@keyframes highlight-glow {
    0% {background-color: transparent;}
    50% {background-color: rgba(79, 70, 229, 0.4);}
    /* Malo jača ljubičasta */
    100% {background-color: transparent;}
}



.highlight-active {
    /* 0.7s x 3 ponavljanja = 2.1s ukupno trajanje */
    animation: highlight-glow 0.7s ease-in-out 3;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

/* Sakrivanje gumba za prijavljene */
.hidden {
    display: none !important;
}

/* Priprema za kvačicu unutar checkboxa */
.checkbox-custom::after {
    content: '';
    width: 12px;
    /* Smanjena veličina kvačice (sa 100% na ~60%) */
    height: 12px;
    /* KLJUČ: Koristimo tanki, high-end SVG za kvačicu */
    /* Ovo je matematički centrirana, tanka (stroke-width: 2.5) kvačica */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    /* Početno stanje: nevidljivo i smanjeno */
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Lagani "pop-in" efekt */
}


/* Kontejner postaje ljubičast */
.sidebar-menu li.selected .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
    /* Suptilni sjaj */
}


/* Kvačica unutra postaje vidljiva, centrirana i "poveća se" na pravu veličinu */
.sidebar-menu li.selected .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

/* Animacija za menu-icon (svijetli 2 puta svakih 10s) */
@keyframes pulse-menu {
    0%,
    80%,
    100% {
        transform: scale(1);
        opacity: 1;
        color: var(--text-main);
    }
    85%,
    95% {
        transform: scale(1.7);
        color: var(--primary);
    }
    90% {
        transform: scale(1);
        color: var(--primary);
    }
}

.pulse-active {
    animation: pulse-menu 3s infinite; /* Skraćeno s 10s na 3s za bolji efekt */
}

/* U Dark Modeu, checkbox ostaje vidljiv */
body.dark-mode .checkbox-custom {
    background: var(--white);
    /* Tamno navy u tvojoj konfiguraciji */
    border-color: rgba(255, 255, 255, 0.2);
}





.subject-name {
    font-weight: 600;
    min-width: 150px; /* Osigurava da imena predmeta kreću od iste točke */
}














/* style.css */

.subject-popout {
    position: absolute;
    left: 100%;
    top: 0;
    width: 260px;
    background: var(--white);
    box-shadow: 15px 0 30px rgba(0, 0, 0, 0.1);
    border-radius: 0 12px 12px 12px;
    display: none;
    flex-direction: column;
    padding: 15px 0;
    border: 1px solid #f1f5f9;
    z-index: 1200;
}


/* Prikaži izbornik na hover roditelja */
.nav-mode:hover .subject-popout {
    display: flex;
}

/* Svaki redak predmeta */
.subject-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;      /* Vertikalno centriranje teksta i kruga */
    justify-content: space-between; /* Tekst lijevo, krug desno */
    position: relative;
    transition: 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--sidebar-text);
    cursor: pointer;
}

.subject-item:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

/* Stanje kada je predmet odabran */
.subject-item.selected .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
}

/* Dodavanje bijele kvačice unutar kruga */
.subject-item.selected .checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 1;
}

/* DARK MODE PODRŠKA */
body.dark-mode .subject-popout {
    background: #0f172a; /* Tamno navy pozadina */
    border-color: #1e293b;
    box-shadow: 15px 0 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .subject-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .checkbox-custom {
    background: #1e293b;
    border-color: #334155;
}








/* --- FIX ZA IZBORNIK PREDMETA --- */


.nav-mode:hover .subject-popout {
    display: flex;
}

.subject-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;      /* Vertikalno centriranje */
    justify-content: space-between; /* Tekst lijevo, krug desno */
    position: relative;
    transition: 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--sidebar-text);
    cursor: pointer;
}

.subject-item:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

/* FIX ZA KRUŽIĆ: Maknuto 'position: absolute' */
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: white;
    display: flex;            /* Omogućuje centriranje kvačice unutra */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;           /* Krug se neće stisnuti */
    transition: all 0.3s ease;
    margin: 0;                /* Reset margina */
}

/* AKTIVNO STANJE: Ljubičasta boja */
.subject-item.selected .checkbox-custom {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
}

/* KVAČICA: SVG unutar kruga */
.subject-item.selected .checkbox-custom::after {
    content: '';
    width: 19px;
    height: 19px;
    /* Popravljen SVG URL s pravilnim kodiranjem za bijelu boju */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
}

/* DARK MODE FIX */
body.dark-mode .subject-popout {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-mode .checkbox-custom {
    background: #1e293b;
    border-color: #334155;
}








