/* --- TVOJ OSNOVNI STIL (ZADRŽAN) --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}
.navbar {
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.container, .container-fluid {
    max-width: 1200px; 
}
.card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.075);
    border: none;
    margin-bottom: 1.5rem;
}
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}
/* ISPRAVKA (originalna) */
.btn-primary:hover {
    background-color: #0069d9; 
    border-color: #0062cc;
}
.login-container, .register-container {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.table thead th {
    background-color: #e9ecef;
    border-bottom: 2px solid #dee2e6;
}

/* ================================================================ */
/* === DODATO: STILOVI ZA KOMPAKTNIJE I PREGLEDNIJE TABELE === */
/* ================================================================ */
.table {
    font-size: 0.9rem; /* Smanjuje osnovni font sa 16px na ~14.4px */
    vertical-align: middle; /* Vertikalno centrira sav sadržaj u ćelijama (dugmad, tekst...) */
}
.table td, .table th {
    padding: 0.5rem 0.75rem; /* Smanjuje vertikalni padding, čini redove znatno nižim */
}
.table td strong {
    margin-bottom: 2px; /* Mali razmak između naziva i registracije */
    display: block; /* Osigurava da margin-bottom radi kako treba */
}
.table td small {
    font-size: 0.8rem; /* Dodatno smanjuje font za registarsku oznaku */
    line-height: 1; /* Smanjuje visinu linije za registraciju da zauzima manje mesta */
}
/* ================================================================ */


/* --- NOVI I POBOLJŠANI STILOVI ZA DASHBOARD --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    border-left: 5px solid #007bff;
}
.stat-card h4 {
    margin-bottom: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}
.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0;
    color: #343a40;
}
.stat-card.revenue { border-left-color: #28a745 !important; }
.stat-card.expense { border-left-color: #dc3545 !important; }
.stat-card.unpaid { border-left-color: #ffc107 !important; }
.stat-card.liabilities { border-left-color: #fd7e14 !important; }

/* ----------------------------------------------------------------- */
/* --- FINALNA ISPRAVKA ZA GRAFIKON (ZA ODSECANJE) --- */
/* ----------------------------------------------------------------- */
.chart-container {
    background: #fff;
    padding: 1.5rem; /* Malo smanjujemo padding da grafikon ima više mesta */
    border-radius: 0.5rem;
    margin-top: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.075);
    height: auto; 
}

/* NOVI DEO: Dodajemo omotač oko samog <canvas> elementa */
.chart-canvas-wrapper {
    position: relative;
    height: 400px; /* Sada fiksnu visinu postavljamo ovde */
    width: 100%;
}
/* ----------------------------------------------------------------- */

/* --- OSTALI STILOVI --- */
.ai-response {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #e9f7fd;
    border-left: 5px solid #007bff;
    border-radius: 0.25rem;
}
#invoice-items-table .form-control, #items-table .form-control {
    padding: 0.25rem 0.5rem;
    height: auto;
}
#invoice-totals {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

/* --- ISPRAVKA ZA FIKSIRANI FUTERA --- */
.main-content {
}
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
}

/* ================================================================ */
/* === STIL ZA SLIKU PROFILA U HEADERU === */
/* ================================================================ */

.profile-avatar-small {
    width: 28px;            /* Fiksna širina */
    height: 28px;           /* Fiksna visina */
    border-radius: 50%;     /* Ovo čini sliku savršeno okruglom */
    object-fit: cover;      /* Ovo osigurava da slika lepo popuni krug, bez izobličenja */
    border: 1px solid rgba(255, 255, 255, 0.5); /* Opcioni beli, poluprovidni okvir */
}

/* Onemogućava selektovanje teksta na celoj stranici */
body {
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* Standardna sintaksa */
}

/* ===================================================================== */
/* === STILOVI ZA VIDEO POZADINU NA GATEKEEPER STRANICI === */
/* ===================================================================== */

body.gate-page {
    background: #343a40; 
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden; 
}

.gate-page #bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: -100;
    object-fit: cover;
}

.gate-page .video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -99;
}

.gate-page .gate-container {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9); 
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    text-align: center;
    position: relative; 
    z-index: 10;
}
.gate-page .password-container {
    position: relative;
}
.gate-page .password-container i {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
}

/* ================================================================ */
/* === STIL ZA CUSTOM FILE INPUT (SKRAĆIVANJE IMENA FAJLA) === */
/* ================================================================ */

.custom-file-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 85px; 
}

/* ================================================================ */
/* === STILOVI ZA PANEL SA BELEŠKAMA === */
/* ================================================================ */

/* Plutajuće dugme (bubble) */
.notes-fab {
    position: fixed;
    bottom: 80px; /* Malo iznad futera */
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1050;
    transition: transform 0.2s ease-in-out;
}
.notes-fab:hover {
    transform: scale(1.1);
}

/* Panel sa beleškama koji izlazi sa strane */
.notes-panel {
    position: fixed;
    top: 0;
    right: -380px; /* Početna pozicija, sakriven van ekrana */
    width: 350px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0,0,0,0.15);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

/* Stil kada je panel aktivan (vidljiv) */
.notes-panel.is-open {
    right: 0;
}

.notes-panel-header {
    padding: 1rem;
    background-color: #343a40;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notes-panel-header h5 {
    margin: 0;
}
.notes-panel-header .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    opacity: 0.8;
}
.notes-panel-header .close-btn:hover {
    opacity: 1;
}

.notes-panel-body {
    flex-grow: 1;
    padding: 1rem;
}

.notes-panel-body textarea {
    width: 100%;
    height: calc(100% - 60px); /* Oduzimamo visinu futera panela */
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 1rem;
    resize: none; /* Onemogućavamo promenu veličine */
}
.notes-panel-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    text-align: right;
}

/* ================================================================ */
/* === STILOVI ZA AI ANALYST BUBBLE (NOVO) === */
/* ================================================================ */

.ai-analyst-fab {
    position: fixed;
    /* Pozicioniramo ga iznad dugmeta za beleške */
    /* (80px od dna za beleške + 60px visina dugmeta + 20px razmak) = 160px */
    bottom: 160px; 
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #6f42c1; /* Ljubičasta boja za AI */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1050;
    transition: all 0.2s ease-in-out;
}

.ai-analyst-fab:hover {
    transform: scale(1.1);
    background-color: #5a37a0; /* Malo tamnija ljubičasta na hover */
}

/* ================================================================ */
/* === STIL ZA LINK U FUTERU === */
/* ================================================================ */

.footer a {
    color: #1DB954 !important; /* Spotify zelena boja */
    text-decoration: none;   /* Uklanja podvučenu liniju */
    transition: color 0.2s ease-in-out; /* Glatka promena boje na hover */
}

.footer a:hover {
    color: #1ED760 !important; /* Malo svetlija zelena kada se pređe mišem */
}

/* ========================================= */
/* ===== DARK MODE THEME STYLES START ====== */
/* ========================================= */

/* Primena klase na <html> element umesto <body> daje bolju kontrolu */
html.dark-mode body {
    background-color: #1a202c; /* Tamno plavo-siva pozadina */
    color: #cbd5e0; /* Svetlo siva boja teksta */
}

/* Kartice, tabele i forme */
html.dark-mode .card {
    background-color: #2d3748;
    border-color: #4a5568;
}

html.dark-mode .card-header {
    background-color: #1d2430;
    border-bottom: 1px solid #4a5568;
}

html.dark-mode .card-body,
html.dark-mode .card-footer {
     border-top: 1px solid #4a5568;
}


html.dark-mode h1, html.dark-mode h2, html.dark-mode h3, html.dark-mode h4, html.dark-mode h5, html.dark-mode h6 {
    color: #e2e8f0;
}

/* Tabele */
html.dark-mode .table {
    color: #cbd5e0;
}

html.dark-mode .table th,
html.dark-mode .table td {
    border-color: #4a5568;
}

html.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.1);
}

html.dark-mode .table-hover tbody tr:hover {
    background-color: #4a5568;
    color: #fff;
}

/* Linkovi */
html.dark-mode a {
    color: #63b3ed; /* Svetlo plava za linkove */
}
html.dark-mode a:hover {
    color: #90cdf4;
}

/* Dugmići */
html.dark-mode .btn-light {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

html.dark-mode .btn-light:hover {
    background-color: #718096;
}

/* Polja za unos */
html.dark-mode .form-control {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

html.dark-mode .form-control:focus {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #63b3ed;
    box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}
html.dark-mode .form-control::placeholder {
  color: #a0aec0;
}

/* Dropdown meniji */
html.dark-mode .dropdown-menu {
    background-color: #2d3748;
    border-color: #4a5568;
}

html.dark-mode .dropdown-item {
    color: #cbd5e0;
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background-color: #4a5568;
    color: #fff;
}
html.dark-mode .dropdown-divider {
    border-top: 1px solid #4a5568;
}
html.dark-mode .dropdown-header {
    color: #a0aec0;
}

/* Modali (popup prozori) */
html.dark-mode .modal-content {
    background-color: #2d3748;
}
html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    border-color: #4a5568;
}
html.dark-mode .close {
    color: #cbd5e0;
    text-shadow: none;
}
html.dark-mode .close:hover {
    color: #fff;
}

/* Custom kontrole (checkbox, radio...) */
html.dark-mode .custom-select,
html.dark-mode .custom-file-label {
    background-color: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

/* Specifične klase */
html.dark-mode .list-group-item {
     background-color: #2d3748;
     border-color: #4a5568;
}

/* ========================================= */
/* ======    DODATAK: STIL ZA FUTER     ====== */
/* ========================================= */

/* Stilovi za futer u tamnoj temi */
html.dark-mode .footer {
    background-color: #1d2430; /* Tamna pozadina, kao header kartica */
    border-top: 1px solid #4a5568; /* Tamna linija na vrhu */
}

/* Osiguravamo da je tekst u futeru svetao i čitljiv */
html.dark-mode .footer .text-muted {
    color: #a0aec0 !important; /* Svetlo siva boja za tekst */
}

/* Ažuriramo i boju linka u futeru da prati novi stil */
html.dark-mode .footer a {
    color: #63b3ed !important; /* Svetlo plava, kao i ostali linkovi */
}
html.dark-mode .footer a:hover {
    color: #90cdf4 !important;
}