/* ===== GLAVNI CSS FAJL ===== */

:root {
    /* Čiste, moderne boje */
    --primary-color: #2563eb;        /* Plava */
    --secondary-color: #64748b;      /* Siva */
    --success-color: #059669;        /* Zelena */
    --danger-color: #dc2626;         /* Crvena */
    --warning-color: #d97706;        /* Narandžasta */
    --info-color: #0891b2;           /* Tirkizna */
    
    /* Neutralne boje */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Layout */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Animacije */
    --transition: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
}

/* ===== GLOBALNI STILOVI ===== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ===== NAVBAR ===== */

.navbar-custom {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--gray-100);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--gray-100);
}

/* ===== KARTICE ===== */

.card-custom {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card-custom:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header-custom {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-body-custom {
    padding: 1.5rem;
}

/* ===== STATISTIKE ===== */

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.info::before { background: var(--info-color); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--primary-color);
    color: var(--white);
}

.stat-card.success .stat-icon { background: var(--success-color); }
.stat-card.warning .stat-icon { background: var(--warning-color); }
.stat-card.info .stat-icon { background: var(--info-color); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.stat-label {
    color: var(--gray-600);
    font-weight: 500;
    margin: 0;
}

/* ===== DUGMAD ===== */

.btn-custom {
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary-custom {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary-custom:hover {
    background: #1d4ed8;
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success-custom {
    background: var(--success-color);
    color: var(--white);
}

.btn-success-custom:hover {
    background: #047857;
    color: var(--white);
    transform: translateY(-1px);
}

.btn-danger-custom {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger-custom:hover {
    background: #b91c1c;
    color: var(--white);
    transform: translateY(-1px);
}

.btn-warning-custom {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning-custom:hover {
    background: #c2410c;
    color: var(--white);
    transform: translateY(-1px);
}

.btn-secondary-custom {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary-custom:hover {
    background: var(--gray-300);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-sm-custom {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg-custom {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===== FORME ===== */

.form-control-custom {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-label-custom {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.form-select-custom {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
    cursor: pointer;
}

.form-select-custom:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* ===== TABELE ===== */

.table-custom {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-custom table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.table-custom th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table-custom td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: var(--gray-50);
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}

/* ===== AVATARI ===== */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

/* ===== BADGES ===== */

.badge-custom {
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary { background: var(--primary-color); color: var(--white); }
.badge-success { background: var(--success-color); color: var(--white); }
.badge-warning { background: var(--warning-color); color: var(--white); }
.badge-danger { background: var(--danger-color); color: var(--white); }
.badge-info { background: var(--info-color); color: var(--white); }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* ===== MODALI ===== */

.modal-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-custom.show {
    opacity: 1;
    visibility: visible;
}

.modal-content-custom {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-custom.show .modal-content-custom {
    transform: scale(1);
}

.modal-header-custom {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-custom {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body-custom {
    padding: 1.5rem;
}

.modal-footer-custom {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== ALERTOVI ===== */

.alert-custom {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    border: 1px solid;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #dcfdf7;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.alert-info {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0c4a6e;
}

/* ===== LOADING ===== */

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== DIOPTRIJA PRIKAZ ===== */

.diopter-display {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.eye-section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.eye-header {
    color: var(--gray-700);
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .btn-custom {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .modal-content-custom {
        width: 95%;
        margin: 1rem;
    }
    
    .table-custom {
        font-size: 0.875rem;
    }
    
    .table-custom th,
    .table-custom td {
        padding: 0.75rem 0.5rem;
    }
}

/* ===== UTILITIES ===== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }