/* Stilovi za Sistem za upravljanje ugovorima */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.25s ease-out forwards;
}

.animate-slide-in {
    animation: slideInRight 0.3s ease-out forwards;
}

/* Modal backdrop blur */
.modal-backdrop {
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
}

.badge-active {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-warning {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-expired {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Risk Badges */
.risk-low {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.risk-medium {
    background-color: #fef9c3;
    color: #a16207;
    border: 1px solid #fde047;
}

.risk-high {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* Custom Table Polish */
.data-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: #64748b;
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Print styles */
@media print {
    header, nav, #btn-export, .no-print, button {
        display: none !important;
    }
    body {
        background-color: white !important;
    }
    .data-table th, .data-table td {
        border-bottom: 1px solid #ccc !important;
    }
}

/* Calendar Styles */
.calendar-day-cell {
    min-height: 90px;
    transition: all 0.15s ease;
}
.calendar-day-cell:hover {
    background-color: #f8fafc;
}
.calendar-day-today {
    background-color: #eff6ff !important;
    border-color: #3b82f6 !important;
}
.calendar-badge {
    display: block;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.calendar-badge:hover {
    opacity: 0.85;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.toast-success {
    background-color: #10b981;
    color: white;
}

.toast-error {
    background-color: #ef4444;
    color: white;
}

.toast-info {
    background-color: #2563eb;
    color: white;
}

.toast-warning {
    background-color: #f59e0b;
    color: white;
}

/* ========================================================================= */
/* TAG BADGES & CHIPS */
/* ========================================================================= */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}

.tag-badge:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* ========================================================================= */
/* DARK MODE (NOĆNI REŽIM) */
/* ========================================================================= */
html.dark {
    color-scheme: dark;
}

html.dark body {
    background-color: #0b0f19;
    color: #f1f5f9;
}

html.dark #app-screen {
    background-color: #0b0f19;
}

html.dark header {
    background-color: #111827;
    border-color: #1f2937;
}

html.dark .bg-white {
    background-color: #111827 !important;
}

html.dark .bg-slate-50, 
html.dark .bg-slate-50\/50, 
html.dark .bg-slate-50\/70, 
html.dark .bg-slate-50\/80,
html.dark .bg-slate-100 {
    background-color: #1f2937 !important;
}

html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-slate-200:hover {
    background-color: #374151 !important;
}

/* Dugmad u zaglavlju u tamnom modu (Backup, Email, Zvonce, Noćni režim) */
html.dark #btn-header-backup,
html.dark #btn-header-email,
html.dark #btn-notification-bell,
html.dark #btn-theme-toggle {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}

html.dark #btn-header-backup span,
html.dark #btn-header-email span {
    color: #f3f4f6 !important;
}

html.dark #btn-header-backup:hover,
html.dark #btn-header-email:hover,
html.dark #btn-notification-bell:hover,
html.dark #btn-theme-toggle:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

html.dark .border-slate-100, 
html.dark .border-slate-200, 
html.dark .border-slate-300 {
    border-color: #374151 !important;
}

html.dark .text-slate-900, 
html.dark .text-slate-800, 
html.dark .text-slate-700 {
    color: #f3f4f6 !important;
}

html.dark .text-slate-600, 
html.dark .text-slate-500 {
    color: #9ca3af !important;
}

html.dark .text-slate-400 {
    color: #6b7280 !important;
}

html.dark input, 
html.dark select, 
html.dark textarea {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f9fafb !important;
}

html.dark input::placeholder, 
html.dark textarea::placeholder {
    color: #6b7280 !important;
}

html.dark .data-table th {
    background-color: #1f2937 !important;
    color: #9ca3af !important;
    border-color: #374151 !important;
}

html.dark .data-table td {
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

html.dark .data-table tr:hover td {
    background-color: #1f2937 !important;
}

html.dark .calendar-day-cell {
    border-color: #374151 !important;
}

html.dark .calendar-day-cell:hover {
    background-color: #1f2937 !important;
}

html.dark .calendar-day-today {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
}

html.dark .tag-badge {
    background-color: #1f2937;
    color: #cbd5e1;
    border-color: #374151;
}

html.dark .tag-badge:hover {
    background-color: #374151;
    color: #ffffff;
}

html.dark .nav-tab.text-slate-600:hover {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
}

html.dark #notifications-dropdown {
    background-color: #111827 !important;
    border-color: #374151 !important;
}

/* ========================================================================= */
/* KARTICA UGOVORA ZA ŠTAMPU (A4 ZVANIČNI DOKUMENT) */
/* ========================================================================= */
@media print {
    /* Kada je aktivna kartica ugovora, sakrij ceo interfejs i prikaži samo nju */
    body.printing-card #app-screen,
    body.printing-card .modal-backdrop,
    body.printing-card header,
    body.printing-card #toast-container {
        display: none !important;
    }

    body.printing-card #contract-print-card,
    body.printing-card #employee-print-card {
        display: block !important;
        background: white !important;
        color: black !important;
        padding: 15mm 15mm;
        font-family: Arial, Helvetica, sans-serif;
    }
}

/* ========================================================================= */
/* SEGMENTED PILL TABS ZA UGOVORE RADNIKA & EVIDENCIJA ISTICANJA             */
/* ========================================================================= */

.emp-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background-color: #f8fafc;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.emp-pill-tab {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    user-select: none;
}

.emp-pill-tab.active {
    background-color: #ffffff;
    color: #1e40af;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.07);
}

.emp-pill-tab:not(.active) {
    color: #64748b;
}

.emp-pill-tab:not(.active):hover {
    color: #0f172a;
    background-color: #ffffff;
}

.badge-expiry-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-expiry-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    animation: pulse-soft 2.5s infinite;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
}

.print-card-box {
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.print-card-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.print-card-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.print-card-table th, 
.print-card-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    font-size: 11px;
    text-align: left;
}

.print-card-table th {
    background-color: #f1f5f9;
    font-weight: bold;
}

/* ========================================================================= */
/* MOBILNI DIZAJN I PRILAGOĐAVANJE ZA TELEFONE (RESPONSIVE MOBILE UX)        */
/* ========================================================================= */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

.mobile-bottom-bar {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobilna kartica ugovora */
.mobile-contract-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid #e2e8f0;
}
.mobile-contract-card:active {
    transform: scale(0.99);
}

@media (max-width: 767px) {
    /* Sprečavanje neželjenog automatskog zumiranja na iOS Safari pri fokusiranju inputa */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Modalni prozori na telefonu */
    .modal-backdrop {
        padding: 0.5rem !important;
        align-items: flex-end !important;
    }
    .modal-backdrop > div:not(#modal-mobile-menu div) {
        max-height: 94vh !important;
        border-radius: 1.25rem !important;
        width: 100% !important;
    }
}

/* Dark mode za mobilne elemente */
html.dark .mobile-bottom-bar {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

html.dark .mobile-contract-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

html.dark #modal-mobile-menu .bg-white {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

/* Dark mode za sekciju zaposlenih i badževe */
html.dark .bg-purple-50\/40,
html.dark .bg-purple-50 {
    background-color: rgba(147, 51, 234, 0.15) !important;
    border-color: rgba(168, 85, 247, 0.25) !important;
}
html.dark .bg-purple-100 {
    background-color: rgba(147, 51, 234, 0.3) !important;
}
html.dark .text-purple-800,
html.dark .text-purple-700 {
    color: #d8b4fe !important;
}
html.dark .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.15) !important;
}
html.dark .text-emerald-700 {
    color: #6ee7b7 !important;
}
html.dark .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.15) !important;
}
html.dark .text-amber-800,
html.dark .text-amber-700 {
    color: #fcd34d !important;
}
html.dark .bg-blue-50,
html.dark .bg-blue-50\/50 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}
html.dark .border-blue-100,
html.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.3) !important;
}
html.dark .text-blue-800,
html.dark .text-blue-700,
html.dark .text-blue-600 {
    color: #93c5fd !important;
}

/* ==========================================================================
   STILOVI ZA VERZIJU 3.0: DRAG & DROP, SPOTLIGHT, PRAVNI ŠABLONI I REALIZACIJA
   ========================================================================== */

/* Drag & Drop aktivna zona */
.dropzone-active {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Spotlight rezultati */
.spotlight-item {
    transition: all 0.15s ease-in-out;
}
.spotlight-item:hover,
.spotlight-item.active {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(3px);
}
html.dark .spotlight-item:hover,
html.dark .spotlight-item.active {
    background-color: #334155;
    border-color: #475569;
}

/* Realizacija progress bar prelivi */
.progress-safe {
    background: linear-gradient(90deg, #10b981, #059669);
}
.progress-warning {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}
.progress-danger {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Štampanje pravnih akata (A4) */
@media print {
    body.printing-template #app-screen,
    body.printing-template header,
    body.printing-template .mobile-bottom-bar,
    body.printing-template #modal-spotlight,
    body.printing-template #modal-employee-leaves,
    body.printing-template #modal-contract-realizacija,
    body.printing-template .modal-backdrop:not(#modal-document-template) {
        display: none !important;
    }

    body.printing-template #modal-document-template {
        display: block !important;
        position: static !important;
        background: white !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.printing-template #modal-document-template > div {
        max-width: 100% !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    body.printing-template #modal-document-template .border-b,
    body.printing-template #modal-document-template .bg-slate-50,
    body.printing-template #modal-document-template button {
        display: none !important;
    }

    body.printing-template #template-print-page {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10mm 15mm !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }
}



