/* s1 - Glavni Stilovi 
   Putanja: public/assets/css/style.css
   Update: Potpuna Mobilna prilagodba (Responsive Design)
*/

:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text-main: #f8fafc;
    --bg-body: #f1f5f9;
    --success: #166534;
    --success-bg: #dcfce7;
    --danger: #991b1b;
    --danger-bg: #fee2e2;
    --border: #e2e8f0;
}

body { font-family: 'Inter', sans-serif; margin: 0; background: var(--bg-body); color: #1e293b; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
.app-container { display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.sidebar { width: 260px; background: var(--sidebar-bg); color: var(--text-main); display: flex; flex-direction: column; flex-shrink: 0; transition: all 0.3s ease; }
.sidebar-header { padding: 25px; font-size: 20px; font-weight: 700; background: #0f172a; display: flex; align-items: center; gap: 10px; }
.sidebar-nav { padding: 20px 0; flex-grow: 1; }
.nav-label { padding: 15px 25px 5px; font-size: 11px; text-transform: uppercase; color: #64748b; letter-spacing: 1px; }
.sidebar-nav a { padding: 12px 25px; display: flex; align-items: center; gap: 12px; color: #94a3b8; text-decoration: none; transition: 0.2s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active { border-left: 4px solid var(--primary); }
.logout-link { margin-top: auto; border-top: 1px solid #334155; color: #f87171 !important; }

/* --- CONTENT AREA --- */
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow-x: hidden; width: 100%; }
.top-bar { height: 60px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; padding: 0 30px; }
.page-container { padding: 30px; }
.page-header { margin-bottom: 25px; }
.page-header h1 { margin: 0; font-size: 24px; font-weight: 700; color: #0f172a; }

/* --- KOMPONENTE (Cards & Grid) --- */
.grid { display: flex; gap: 20px; flex-wrap: wrap; }
.col-4 { flex: 4; min-width: 300px; }
.col-8 { flex: 8; min-width: 350px; }
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--border); margin-bottom: 20px; }
.card h3 { margin-top: 0; margin-bottom: 20px; font-size: 16px; font-weight: 600; color: #475569; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

/* --- FORME I INPUTI --- */
.form-group label { display: block; margin: 15px 0 5px; font-weight: 600; font-size: 13px; color: #475569; }
.form-group input, .form-select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; box-sizing: border-box; font-size: 14px; transition: 0.2s; background: #fff; }
.form-group input:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 20px; width: 100%; border-radius: 6px; margin-top: 20px; cursor: pointer; font-weight: 600; font-size: 14px; transition: 0.2s; }
.btn-primary:hover { background: var(--primary-dark); }

/* --- TABELE --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; padding: 12px 15px; text-align: left; font-size: 12px; text-transform: uppercase; color: #64748b; font-weight: 700; border-bottom: 2px solid var(--border); }
.data-table td { padding: 15px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:hover { background: #fcfcfd; }

/* --- STATUSI --- */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; display: inline-block; }
.status-badge.online { background: var(--success-bg); color: var(--success); }
.status-badge.offline { background: var(--danger-bg); color: var(--danger); }

/* --- MEDIA BIBLIOTEKA --- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.media-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f8fafc; }
.media-item img { width: 100%; height: 120px; object-fit: cover; border-bottom: 1px solid var(--border); }
.video-placeholder { width: 100%; height: 120px; background: #334155; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; }

/* --- LOG BOJE --- */
.log-row-success { background-color: #e6ffed !important; border-left: 5px solid #0a4d14 !important; }
.log-row-warning { background-color: #fff9e6 !important; border-left: 5px solid #d99100 !important; }
.log-row-error   { background-color: #fee2e2 !important; border-left: 5px solid #991b1b !important; }
.badge-success { background-color: #0a4d14 !important; color: white !important; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.badge-warning { background-color: #d99100 !important; color: white !important; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.badge-error   { background-color: #991b1b !important; color: white !important; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; }

/* ==========================================================================
   RESPONSIVE (MOBILNA PRILAGODBA)
   ========================================================================== */

@media (max-width: 992px) {
    .col-4, .col-8 { flex: 100%; min-width: 100%; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    
    /* Sidebar postaje gornji horizontalni meni sa skrolom */
    .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 999; }
    .sidebar-header { padding: 10px 20px; font-size: 16px; justify-content: space-between; }
    
    .sidebar-nav { 
        display: flex; 
        flex-direction: row;
        overflow-x: auto; 
        padding: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    
    .sidebar-nav a { 
        padding: 15px 18px; 
        flex-direction: column; 
        gap: 4px; 
        font-size: 11px; 
        border-left: none !important;
        border-bottom: 3px solid transparent;
        text-align: center;
        flex: 1 0 auto;
    }
    
    .sidebar-nav a.active { 
        border-bottom: 3px solid var(--primary); 
        background: var(--sidebar-hover); 
    }

    /* Na baš malim ekranima sakrivamo tekst menija da bi stalo više ikonica */
    @media (max-width: 480px) {
        .sidebar-nav a span { display: none; }
        .sidebar-nav a i { font-size: 18px; }
    }
    
    .nav-label { display: none; }
    .logout-link { border-top: none; border-left: 1px solid #334155; margin-top: 0; }

    /* Sadržaj */
    .top-bar { display: none; } /* Sakrivamo top bar na mobitelu jer imamo sidebar gore */
    .page-container { padding: 15px; margin-top: 0; }
    .page-header h1 { font-size: 18px; }

    /* Tabele postaju skrolabilne kartice */
    .card { overflow-x: auto; padding: 15px; }
    .data-table { min-width: 500px; }
    .data-table td, .data-table th { padding: 10px; font-size: 13px; }

    /* Forme - sprečavanje zumiranja na iPhone-u */
    .grid { gap: 10px; }
    .form-group input, .form-select { font-size: 16px; padding: 10px; }
    .btn-primary { padding: 15px; font-size: 16px; }
}

/* Media Grid Sličice */
@media (max-width: 480px) {
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .media-item img, .video-placeholder { height: 90px; }
}