/* style.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* UNIFORMIZACIJA FONTA: Svi UI elementi nasleđuju font definisan u body */
input, select, textarea, button, .action-btn, .btn-submit {
    font-family: inherit;
}

/* HEADER */
.app-header {
    background-color: white;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

.logo-area {
    display: flex;
    align-items: center;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--secondary-color);
}

.logo-text small {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.user-info {
    font-weight: bold;
    color: var(--primary-color);
}

.user-info a {
    color: #e74c3c;
    text-decoration: none;
    margin-left: 15px;
    font-size: 0.9rem;
    border: 1px solid #e74c3c;
    padding: 5px 10px;
    border-radius: 4px;
}

/* LAYOUT CONTAINER */
.app-container {
    display: flex;
    margin-top: var(--header-height);
    /* Da ne ide ispod hedera */
    flex: 1;
    /* Gura futer dole */
}

/* SIDEBAR */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: #ecf0f1;
    position: fixed;
    bottom: 0;
    top: var(--header-height);
    overflow-y: auto;
    padding-top: 20px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background-color: #34495e;
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-label {
    padding: 15px 20px 5px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #7f8c8d;
    font-weight: bold;
    margin-top: 10px;
}

/* MAIN CONTENT */
.app-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* FOOTER */
.app-footer {
    margin-left: var(--sidebar-width);
    text-align: center;
    padding: 15px;
    background: #ecf0f1;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #bdc3c7;
}

/* FORMS & TABLES (Stari stilovi prilagođeni) */
form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    max-width: 100%;
    /* Da iskoristi prostor */
}

fieldset {
    border: 1px solid #eee;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}

legend {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--secondary-color);
    padding: 0 10px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* ---------------------------------------------------------------- */
/* STILIZOVANJE DUGMADI I LINKOVA KOJI IZGLEDAJU KAO DUGMAD       */
/* ---------------------------------------------------------------- */

/* Opšti stil za button elemente, input[type="submit"] i .btn-submit */
.btn-submit, button, input[type="submit"] {
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s, opacity 0.2s;
    border: none;
    /* Font inherit je već rešen u prethodnom koraku */
}

/* Primarni (plavi) stil za .btn-submit */
.btn-submit, button[type="submit"]:not([class*="btn-danger"]) {
    background-color: #3498db; /* Plava */
    color: #ffffff;
}

.btn-submit:hover, button[type="submit"]:not([class*="btn-danger"]):hover {
    background-color: #2980b9; /* Tamnija plava */
}

/* DANGER DUGME (Brisanje) - sada izgleda kao malo crveno dugme */
.btn-delete { 
    background-color: #e74c3c; /* Crvena */
    color: #ffffff; 
    text-decoration: none; 
    font-weight: bold;
    padding: 5px 10px; /* Manji padding */
    border-radius: 5px;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-delete:hover { 
    background-color: #c0392b; /* Tamnija crvena */
    text-decoration: none; /* Uklonimo underline na hover */
}

/*
.btn-submit,
.btn-add-item {
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-submit:hover {
    background-color: #2980b9;
}

.btn-add-item {
    background: #27ae60;
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 8px 15px;
}

.btn-delete {
    color: #e74c3c;
    text-decoration: none;
    font-weight: bold;
}

*/

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.styled-table thead tr {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.styled-table tbody tr:hover {
    background-color: #f9f9f9;
}

.poruka {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.poruka.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.poruka.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* ============================ */
/* STILOVI ZA LOGIN STRANICU    */
/* ============================ */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Zauzima sav preostali prostor po visini */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Lepa pozadina */
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Duboka senka za 3D efekat */
    text-align: center;
    border-top: 5px solid var(--primary-color); /* Plava linija na vrhu */
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.8rem;
}

.login-header p {
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 0.95rem;
}

.login-card .grid-item {
    text-align: left;
    margin-bottom: 20px;
}

.login-card input[type="text"], 
.login-card input[type="password"] {
    background-color: #f9f9f9;
    padding: 12px;
    border: 1px solid #e0e0e0;
    transition: border-color 0.3s;
}

.login-card input:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    outline: none;
}

.login-card .btn-submit {
    width: 100%; /* Dugme preko cele širine */
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

.login-footer {
    margin-top: 25px;
    font-size: 0.85rem;
    color: #bdc3c7;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* STIL ZA BANER (O APLIKACIJI) */
    .welcome-banner {
        background: #fff;
        border-radius: 8px;
        padding: 30px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        margin-bottom: 30px;
        border-left: 5px solid #3498db;
    }
    .welcome-banner h1 {
        color: #2c3e50;
        margin-top: 0;
        font-size: 1.8rem;
    }
    .welcome-text p {
        line-height: 1.6;
        color: #555;
        font-size: 1.05rem;
        margin-bottom: 15px;
    }
    
    /* STIL ZA LISTU FUNKCIONALNOSTI */
    .feature-list {
        list-style: none;
        padding: 0;
        margin-top: 25px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    .feature-item {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        padding: 15px;
        border-radius: 6px;
        font-size: 0.9rem;
        color: #495057;
    }
    .feature-title {
        color: #3498db;
        font-weight: bold;
        display: block;
        margin-bottom: 5px;
        text-transform: uppercase;
        font-size: 0.95rem;
    }

    /* STIL ZA KORAK PO KORAK */
    .steps-container {
        display: flex;
        gap: 20px;
        margin-bottom: 40px;
        flex-wrap: wrap;
    }
    .step-card {
        background: #fff;
        flex: 1;
        min-width: 250px;
        padding: 25px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        position: relative;
        border-top: 4px solid #2ecc71;
    }
    .step-number {
        background: #2ecc71;
        color: white;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    .step-card h4 { margin: 0 0 10px 0; color: #2c3e50; }
    .step-card p { margin: 0; color: #666; line-height: 1.5; font-size: 0.95rem; }

    /* STIL ZA PREČICE (SIDE-BY-SIDE) */
    .shortcuts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* Forsira 3 kolone */
        gap: 20px;
    }
    .shortcut-card {
        background: #fff;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        text-align: center;
        text-decoration: none;
        color: #333;
        transition: transform 0.2s, box-shadow 0.2s;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 1px solid #eee;
    }
    .shortcut-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0,0,0,0.1);
        border-color: #3498db;
    }
    .shortcut-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
        display: block;
    }
    .shortcut-title {
        font-weight: bold;
        font-size: 1.2rem;
        margin-bottom: 5px;
        color: #2c3e50;
    }
    .shortcut-desc {
        font-size: 0.9rem;
        color: #7f8c8d;
    }

    /* Za mobilne telefone - stavi prečice jednu ispod druge */
    @media (max-width: 768px) {
        .shortcuts-grid {
            grid-template-columns: 1fr;
        }
    }

    /* STILOVI ZA AKCIONE DUGMIĆE (IKONICE) */

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 3px;
    font-size: 14px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}


/* Dugme za Edit (Olovka) - Narandžasto */
.btn-edit {
    background-color: #f39c12;
    color: white;
}
.btn-edit:hover {
    background-color: #e67e22;
}

/* Dugme za Delete (Kanta) - Crveno */
.btn-delete-icon {
    background-color: #e74c3c;
    color: white;
}
.btn-delete-icon:hover {
    background-color: #c0392b;
}

/* Centriranje kolone za akcije */
.styled-table td:last-child {
    text-align: center;
    white-space: nowrap;
}
/* =========================================
   MOBILNA NAVIGACIJA (RESPONSIVE)
   ========================================= */

/* --- 1. DESKTOP (PODRAZUMEVANO) - SAKRIVANJE --- */
/* Ovi elementi MORAJU biti sakriveni na velikim ekranima */
    #sidebar-toggle, 
    .mobile-menu-btn,
    .sidebar-mobile-header,
    .mobile-close-btn,
    #sidebar-overlay {
    display: none !important; /* !important osigurava da se ne vide na desktopu */
}

/* --- 2. TABLET I MOBILNI (DO 768px) --- */
@media (max-width: 768px) {

    /* A. Prikazi Hamburger dugme u Headeru */
    #sidebar-toggle, 
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.8rem;
        color: var(--secondary-color);
        cursor: pointer;
        margin-right: 15px;
        z-index: 1100;
    }

    /* B. Sidebar - Inicijalno sakriven (van ekrana levo) */
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Sakriven */
        height: 100vh;
        width: 260px;
        z-index: 2000; /* Veoma visok Z-index da bude iznad svega */
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    }

    /* C. Sidebar - KADA JE OTVOREN (Klasa .active se dodaje JS-om) */
    .app-sidebar.active {
        left: 0 !important; /* Vraća se na ekran */
    }

    /* D. Header unutar Sidebara (Naslov i X dugme) */
    .sidebar-mobile-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        background-color: var(--primary-color);
        color: white;
        font-weight: bold;
    }

    /* E. Dugme X za zatvaranje */
    .mobile-close-btn {
        display: block !important;
        background: none;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        line-height: 1;
    }

    /* F. Zatamnjena pozadina (Overlay) */
    #sidebar-overlay {
        display: none; /* Sakriven dok se ne doda klasa active */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999; /* Odmah ispod sidebara */
        backdrop-filter: blur(2px); /* Fensi efekat zamućenja */
    }

    #sidebar-overlay.active {
        display: block !important;
    }

    /* G. Prilagođavanje glavnog sadržaja */
    .app-content {
        margin-left: 0; 
        width: 100%;
        padding: 15px;
    }

    .app-header {
        padding: 0 15px;
    }
    
    /* Sakrivanje nepotrebnih stvari na mobilnom */
    .logo-text small, 
    .user-name {
        display: none;
    }
    
    /* Popravka tabela */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    .app-footer {
        margin: 0 !important; 
        width: 100% !important;    
        text-align: center;        
        padding: 15px;             
    }
}