/* ============================================================
   IverPlate Theme - MOBILE-OPTIMIZED VERSION
   Performance-focused CSS with touch-first approach
   ============================================================ */

/* ============================================================
   CSS VARIABLES & BASE
   ============================================================ */
:root {
    /* IVERLAND OFICIJALNE BOJE */
    --iverland-orange: #FA5818;
    --iverland-anthracite: #2c2c2c;

    /* SISTEMSKE BOJE */
    --primary-color: #FA5818;
    --secondary-color: #2c2c2c;
    --accent-color: #ff7749;

    /* KATEGORIJSKE BOJE */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;

    /* NEUTRALNE BOJE */
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;

    /* SHADOWS - optimized with pseudo-elements */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================================
   PREFERS REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   BASE STYLES - Mobile First
   ============================================================ */
body {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 50%, #fafafa 100%);
    min-height: 100vh;
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--iverland-anthracite);
    /* Optimize text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================================
   HELPER CLASSES - Reusable gradients & shadows
   ============================================================ */
.gradient-primary {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
}

.gradient-success {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.gradient-warning {
    background: linear-gradient(45deg, var(--warning-color), #f1c40f);
}

.gradient-danger {
    background: linear-gradient(45deg, var(--danger-color), #c0392b);
}

.gradient-info {
    background: linear-gradient(45deg, var(--info-color), #5dade2);
}

.gradient-whatsapp {
    background: linear-gradient(45deg, #25d366, #128c7e);
}

.gradient-light {
    background: linear-gradient(135deg, var(--light-gray), #f0f0f0);
}

/* Shadow helper - using pseudo-elements for better performance */
.shadow-elevated {
    position: relative;
}

.shadow-elevated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    border-radius: inherit;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .shadow-elevated:hover::after {
        opacity: 1;
    }
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
    /* Replace backdrop-filter with solid color */
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    margin: 10px;
    padding: 15px;
    border: 1px solid var(--medium-gray);
    position: relative;
}

/* Optimized shadow using pseudo-element */
.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: 0 20px 40px rgba(250, 88, 24, 0.15);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* ============================================================
   BRAND HEADER
   ============================================================ */
.brand-header {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Optimized shadow for brand header */
.brand-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 10px 30px rgba(250, 88, 24, 0.3);
    pointer-events: none;
    z-index: -1;
}

/* Shine animation - paused by default, only on page load */
.brand-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%) rotate(45deg);
    animation: shine 3s ease-in-out;
    animation-fill-mode: forwards;
    pointer-events: none;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.brand-logo {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ============================================================
   NAVIGATION - Touch optimized
   ============================================================ */
.nav-pills .nav-link {
    border-radius: 12px;
    margin: 4px;
    color: var(--iverland-orange);
    font-weight: 600;
    /* Minimum touch target 44px */
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    position: relative;
    /* Specific transitions instead of 'all' */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
    color: white;
    transform: translateY(-2px);
    will-change: transform;
}

/* Optimized shadow for active nav */
.nav-pills .nav-link.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 5px 15px rgba(250, 88, 24, 0.3);
    pointer-events: none;
    z-index: -1;
}

/* Hover only on devices that support hover */
@media (hover: hover) {
    .nav-pills .nav-link:hover:not(.active) {
        background: var(--light-gray);
        color: var(--iverland-orange);
    }
}

/* ============================================================
   CARDS - Touch optimized
   ============================================================ */
.card {
    border-radius: 12px;
    border: 1px solid var(--medium-gray);
    margin-bottom: 15px;
    position: relative;
    /* Specific transitions */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Optimized card shadow */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 1;
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s ease;
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-3px);
        will-change: transform;
    }

    .card:hover::before {
        opacity: 0;
    }

    .card:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        pointer-events: none;
        z-index: -1;
    }
}

.card-header {
    background: linear-gradient(135deg, var(--light-gray), #f0f0f0);
    color: var(--iverland-orange);
    font-weight: 600;
    border-bottom: 2px solid var(--iverland-orange);
    border-radius: 12px 12px 0 0;
}

/* ============================================================
   BUTTONS - Touch optimized (44px minimum)
   ============================================================ */
.btn {
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    position: relative;
    /* Minimum touch target */
    min-height: 44px;
    min-width: 44px;
    /* Specific transitions */
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
    border: none;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(135deg, var(--accent-color), #ff9966);
        transform: translateY(-2px);
        will-change: transform;
    }

    .btn-primary:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 5px 15px rgba(250, 88, 24, 0.3);
        pointer-events: none;
        z-index: -1;
    }
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #2ecc71);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #f1c40f);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-color), #5dade2);
    border: none;
}

/* ============================================================
   FORMS - Touch optimized
   ============================================================ */
.form-control,
.form-select {
    border-radius: 10px;
    border: 2px solid var(--medium-gray);
    /* Minimum touch target */
    min-height: 44px;
    padding: 10px 15px;
    font-size: 16px;
    /* Prevents zoom on iOS */
    /* Specific transitions */
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--iverland-orange);
    box-shadow: 0 0 0 0.2rem rgba(250, 88, 24, 0.25);
    transform: translateY(-1px);
    outline: none;
}

.form-floating>label {
    color: #6c757d;
    padding: 1rem 0.75rem;
}

.form-floating>.form-control:focus~label {
    color: var(--secondary-color);
}

/* ============================================================
   TABLES - Sticky header optimized
   ============================================================ */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
    color: white;
    border: none;
    font-weight: 600;
    /* Minimum touch target for sortable headers */
    min-height: 44px;
    padding: 14px 12px;
}

.table> :not(caption)>*>* {
    padding: 12px;
    vertical-align: middle;
}

@media (hover: hover) {
    .table tbody tr:hover {
        background-color: rgba(250, 88, 24, 0.1);
        transition: background-color 0.2s ease;
    }
}

/* Sticky table header with will-change */
.salary-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    will-change: transform;
}

.salary-table th,
.salary-table td {
    vertical-align: middle;
}

.salary-table tbody tr:nth-child(odd) {
    background-color: rgba(250, 88, 24, 0.04);
}

@media (hover: hover) {
    .salary-table tbody tr:hover {
        background-color: rgba(250, 88, 24, 0.1);
        transition: background-color 0.2s ease;
    }
}

/* ============================================================
   EMPLOYEE & STATS CARDS
   ============================================================ */
.employee-card {
    background: linear-gradient(45deg, #f8f9fa, var(--light-gray));
    border-left: 5px solid var(--iverland-orange);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .employee-card:hover {
        transform: translateY(-3px) scale(1.01);
        will-change: transform;
    }

    .employee-card:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        pointer-events: none;
        z-index: -1;
    }
}

.stats-card {
    background: linear-gradient(135deg, var(--iverland-orange), var(--accent-color));
    color: white;
    transition: transform 0.3s ease;
}

@media (hover: hover) {
    .stats-card:hover {
        transform: translateY(-3px) rotate(0.5deg);
        will-change: transform;
    }
}

/* ============================================================
   BADGES - Touch targets 44px
   ============================================================ */
.salary-badge,
.bonus-badge,
.penalty-badge {
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Minimum touch target */
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.salary-badge {
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
}

.bonus-badge {
    background: linear-gradient(45deg, var(--warning-color), #f1c40f);
}

.penalty-badge {
    background: linear-gradient(45deg, var(--danger-color), #c0392b);
}

@media (hover: hover) {

    .salary-badge:hover,
    .bonus-badge:hover,
    .penalty-badge:hover {
        transform: scale(1.05);
        will-change: transform;
    }

    .salary-badge:hover::after,
    .bonus-badge:hover::after,
    .penalty-badge:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        pointer-events: none;
        z-index: -1;
    }
}

/* ============================================================
   WHATSAPP BUTTON - Touch optimized
   ============================================================ */
.whatsapp-btn {
    background: linear-gradient(45deg, #25d366, #128c7e);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    /* Minimum touch target */
    min-height: 44px;
    min-width: 44px;
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

@media (hover: hover) {
    .whatsapp-btn:hover {
        background: linear-gradient(45deg, #128c7e, #075e54);
        color: white;
    }

    .whatsapp-btn:hover::before {
        width: 300px;
        height: 300px;
    }
}

/* ============================================================
   CALENDAR - Touch optimized with 44px targets
   ============================================================ */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--medium-gray);
    position: relative;
}

/* Optimized calendar shadow */
.calendar-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: -1;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.calendar-grid {
    border: 1px solid var(--medium-gray);
    border-radius: 10px;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--iverland-orange);
}

.calendar-weekday {
    padding: 10px 5px;
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

/* Touch-optimized calendar days - MINIMUM 44px */
.calendar-day {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--medium-gray);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px;
    position: relative;
    /* Specific transitions */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .calendar-day:hover {
        background: var(--light-gray);
        transform: scale(1.05);
        will-change: transform;
    }
}

.calendar-day.empty {
    background: #f8f9fa;
    cursor: default;
    pointer-events: none;
}

.calendar-day.today {
    background: #0066cc;
    color: white;
    font-weight: bold;
    border: 3px solid #004499;
}

.calendar-day.today::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
    pointer-events: none;
}

.calendar-day.has-absence {
    background: #dc143c;
    color: white;
    font-weight: bold;
    border: 2px solid #a01028;
}

.calendar-day.has-sick {
    background: #ff8c00;
    color: white;
    font-weight: bold;
    border: 2px solid #cc7000;
}

@media (hover: hover) {
    .calendar-day.has-absence:hover {
        background: #ff1a4d;
        transform: scale(1.08);
        will-change: transform;
    }

    .calendar-day.has-absence:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        box-shadow: 0 4px 12px rgba(220, 20, 60, 0.5);
        pointer-events: none;
    }

    .calendar-day.has-sick:hover {
        background: #ffa500;
        transform: scale(1.08);
        will-change: transform;
    }

    .calendar-day.has-sick:hover::after {
        content: '';
        position: absolute;
        inset: 0;
        box-shadow: 0 4px 12px rgba(255, 140, 0, 0.5);
        pointer-events: none;
    }

    .calendar-day.today:hover {
        background: #0077ee;
        transform: scale(1.08);
        will-change: transform;
    }

    .calendar-day.today:hover::after {
        box-shadow: 0 0 15px rgba(0, 119, 238, 0.7);
    }
}

.calendar-day.has-absence.has-sick {
    background: linear-gradient(135deg, #dc143c 50%, #ff8c00 50%);
    color: white;
    font-weight: bold;
    border: 2px solid #8b0000;
}

.calendar-day.today.has-absence {
    background: #dc143c;
    color: white;
    font-weight: bold;
    border: 3px solid #004499;
}

.calendar-day.today.has-absence::after {
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.7);
}

.calendar-day.today.has-sick {
    background: #ff8c00;
    color: white;
    font-weight: bold;
    border: 3px solid #004499;
}

.calendar-day.today.has-sick::after {
    box-shadow: 0 0 15px rgba(255, 140, 0, 0.7);
}

/* Quick classes for absence/sick days */
.absence-day {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.sick-day {
    background-color: var(--warning-color) !important;
    color: white !important;
}

.calendar-legend {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-color.absence {
    background: #dc143c;
    border: 1px solid #a01028;
}

.legend-color.sick {
    background: #ff8c00;
    border: 1px solid #cc7000;
}

.legend-color.today {
    background: #0066cc;
    border: 1px solid #004499;
}

/* ============================================================
   PERCENTAGE INDICATOR
   ============================================================ */
.percentage-indicator {
    background: linear-gradient(90deg, var(--iverland-orange), var(--accent-color));
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

/* ============================================================
   SALARY DETAILS & FILTERS
   ============================================================ */
.salary-details details {
    background: #fff7f0;
    border: 1px solid #ffd7c2;
    border-radius: 12px;
    padding: 8px 10px;
}

.salary-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #b34713;
    /* Touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
}

.details-title {
    margin-top: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #7a2f0d;
}

.details-list {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #2c2c2c;
    font-size: 0.9rem;
}

.details-list li {
    margin-bottom: 4px;
}

.salary-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    background: #fff5ef;
    border: 1px solid #ffd7c2;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.salary-filters .form-label {
    font-weight: 600;
    color: #7a2f0d;
}

.salary-filters .form-control {
    background: #fffdfb;
    border-color: #f3c4ad;
}

.salary-filters .form-control:focus {
    border-color: #fa5818;
    box-shadow: 0 0 0 0.2rem rgba(250, 88, 24, 0.2);
}

.filter-checks {
    display: grid;
    gap: 8px;
}

/* Touch-optimized checkboxes */
.filter-checks .form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-checks .form-check-input {
    min-width: 20px;
    min-height: 20px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filter-actions .btn {
    width: 100%;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
    border-radius: 16px;
    border: 1px solid #ffd7c2;
    position: relative;
}

/* Optimized modal shadow */
.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 20px 40px rgba(250, 88, 24, 0.2);
    pointer-events: none;
    z-index: -1;
}

.modal-header {
    background: linear-gradient(135deg, #fff0e6, #ffe0d1);
    border-bottom: 1px solid #ffd7c2;
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-weight: 700;
    color: #b34713;
}

.salary-details-modal h6 {
    font-weight: 700;
    color: #b34713;
    margin-top: 14px;
}

.salary-details-modal .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #f1c4ad;
    font-size: 0.95rem;
}

.salary-details-modal .detail-row:last-child {
    border-bottom: none;
}

/* ============================================================
   ALERTS - Enhanced
   ============================================================ */
.alert {
    border: none;
    border-radius: 12px;
    font-weight: 500;
    position: relative;
}

/* Optimized alert shadow */
.alert::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: -1;
}

.alert-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.alert-warning {
    background: linear-gradient(45deg, #f39c12, #f1c40f);
    color: white;
}

.alert-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.alert-info {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown-menu {
    border: none;
    border-radius: 10px;
    padding: 8px 0;
    position: relative;
}

/* Optimized dropdown shadow */
.dropdown-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: -1;
}

.dropdown-item {
    padding: 10px 20px;
    /* Touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
    .dropdown-item:hover {
        background: var(--secondary-color);
        color: white;
        transform: translateX(5px);
    }
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.loading {
    display: none;
}

.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(45deg, var(--success-color), #2ecc71);
    transition: width 0.3s ease;
}

/* ============================================================
   FLATPICKR CALENDAR
   ============================================================ */
.flatpickr-calendar {
    border-radius: 10px !important;
    position: relative;
}

/* Optimized flatpickr shadow */
.flatpickr-calendar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    pointer-events: none;
    z-index: -1;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

@media (hover: hover) {
    .flatpickr-day:hover {
        background: var(--secondary-color) !important;
        border-color: var(--secondary-color) !important;
    }
}

/* ============================================================
   SCROLLBAR - Custom
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
    transition: background-color 0.2s ease;
}

@media (hover: hover) {
    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */
.iverland-footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    color: var(--iverland-orange);
    font-size: 0.9rem;
}

.iverland-accent {
    color: var(--iverland-orange);
    font-weight: bold;
}

/* ============================================================
   RESPONSIVE - Mobile First Approach
   ============================================================ */

/* Extra Small Devices - 375px (iPhone SE, small phones) */
@media (min-width: 375px) {
    .brand-logo {
        font-size: 2.2rem;
    }

    .calendar-day {
        font-size: 1rem;
    }
}

/* Small Devices - 480px (most phones in landscape) */
@media (min-width: 480px) {
    .main-container {
        margin: 15px;
        padding: 20px;
        border-radius: 15px;
    }

    .brand-header {
        padding: 25px;
        border-radius: 15px;
    }

    .brand-logo {
        font-size: 2.5rem;
    }

    .nav-pills .nav-link {
        padding: 12px 20px;
    }

    .calendar-day {
        font-size: 1.05rem;
        min-height: 48px;
        min-width: 48px;
    }
}

/* Tablets - 768px */
@media (min-width: 768px) {
    .main-container {
        margin: 20px;
        padding: 30px;
        border-radius: 20px;
    }

    .nav-pills .nav-link {
        margin: 0 5px;
    }

    .card {
        margin-bottom: 20px;
    }

    .table-responsive {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 20px;
    }

    .calendar-day {
        min-height: 52px;
        min-width: 52px;
    }

    .salary-filters {
        padding: 16px;
        gap: 16px;
    }
}

/* ============================================================
   FINANCIAL TRANSACTIONS STYLES
   ============================================================ */

/* Transaction Type Icons and Colors */
.transaction-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.transaction-type-badge:hover {
    transform: scale(1.1);
}

.transaction-type-penalty {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid var(--warning-color);
}

.transaction-type-bonus {
    background: linear-gradient(135deg, #d1f2eb, #a8e6cf);
    border: 2px solid var(--success-color);
}

.transaction-type-deduction {
    background: linear-gradient(135deg, #f8d7da, #ffcccc);
    border: 2px solid var(--danger-color);
}

.transaction-type-installment {
    background: linear-gradient(135deg, #cfe2ff, #b3d7ff);
    border: 2px solid var(--info-color);
}

/* Transaction Amount Styling */
.transaction-amount {
    font-weight: 700;
    font-size: 1.1rem;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

.transaction-amount-positive {
    color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

.transaction-amount-negative {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

/* Installment Progress Badge */
.installment-progress {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--info-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.installment-progress i {
    font-size: 0.75rem;
}

/* Transaction Form Enhancements */
#financialTransactionForm .form-select,
#financialTransactionForm .form-control {
    transition: all 0.3s ease;
}

#financialTransactionForm .form-select:focus,
#financialTransactionForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(250, 88, 24, 0.25);
}

/* Multi-select styling */
#transactionEmployees {
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

#transactionEmployees:focus {
    border-style: solid;
    border-color: var(--primary-color);
}

#transactionEmployees option {
    padding: 8px;
    margin: 2px 0;
    border-radius: 4px;
}

#transactionEmployees option:checked {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

/* Installment Section */
#installmentSection .card {
    border: 2px dashed var(--info-color);
    transition: all 0.3s ease;
}

#installmentSection .card.active {
    border-style: solid;
    background: rgba(52, 152, 219, 0.05);
}

#installmentCalculation {
    border-left: 4px solid var(--info-color);
    margin-top: 12px;
}

#monthlyAmount {
    font-size: 1.3rem;
    color: var(--info-color);
    font-weight: 700;
}

/* WhatsApp Notification Card */
.bg-success.bg-opacity-10 {
    background-color: rgba(37, 211, 102, 0.1) !important;
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 8px;
}

.text-success {
    color: #25d366 !important;
}

/* Filter Section */
.card-header .row {
    align-items: flex-end;
}

.card-header .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--dark-gray);
}

/* Transaction Table Enhancements */
#transactionsList tr {
    transition: all 0.2s ease;
}

#transactionsList tr:hover {
    background: rgba(250, 88, 24, 0.05);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

/* Action Buttons */
.btn-action {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
    color: white;
}

/* Empty State */
#noTransactionsMessage {
    animation: fadeIn 0.5s ease;
}

#noTransactionsMessage i {
    opacity: 0.3;
}

/* Employee Multi-Select Pills */
.employee-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.employee-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.employee-pill.all-employees {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-color: var(--primary-color);
}

/* Responsive adjustments for transactions */
@media (max-width: 768px) {
    .transaction-type-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .transaction-amount {
        font-size: 1rem;
        padding: 3px 8px;
    }

    #transactionsList th,
    #transactionsList td {
        font-size: 0.85rem;
        padding: 8px 4px;
    }

    .installment-progress {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .card-header .row {
        gap: 10px;
    }

    .card-header .col-md-3,
    .card-header .col-md-4,
    .card-header .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Animation for transaction form sections */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#installmentDetails,
#transactionMonthDiv {
    animation: slideDown 0.3s ease;
}

/* Transaction Type Select - Enhanced */
#transactionType option {
    padding: 8px;
    font-weight: 500;
}

/* Focus states for accessibility */
.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(250, 88, 24, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Employee Checkbox List Styling */
#employeeCheckboxList {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f1f1f1;
}

#employeeCheckboxList::-webkit-scrollbar {
    width: 8px;
}

#employeeCheckboxList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#employeeCheckboxList::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

#employeeCheckboxList::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

#employeeCheckboxList .form-check {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

#employeeCheckboxList .form-check:hover {
    background-color: rgba(250, 88, 24, 0.05);
}

#employeeCheckboxList .form-check:last-child {
    margin-bottom: 0;
}

#employeeCheckboxList .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.25rem;
    cursor: pointer;
}

#employeeCheckboxList .form-check-label {
    cursor: pointer;
    user-select: none;
    padding-left: 0.5rem;
    font-size: 0.95rem;
}

/* Installment section enhanced styling */
#installmentSection .card {
    border: 2px solid rgba(13, 202, 240, 0.3);
}

#installmentSection .alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1), rgba(13, 202, 240, 0.2));
    border: 1px solid rgba(13, 202, 240, 0.3);
    color: #055160;
}

#monthlyAmount {
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Loading state for submit button */
#transactionSubmitBtn.loading {
    position: relative;
    color: transparent;
}

#transactionSubmitBtn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Desktop - 1024px */
@media (min-width: 1024px) {
    .main-container {
        max-width: 1200px;
        margin: 30px auto;
    }

    .calendar-day {
        min-height: 56px;
        min-width: 56px;
    }

    .stats-card h3 {
        font-size: 2rem;
    }
}

/* Large Desktop - 1280px+ */
@media (min-width: 1280px) {
    .main-container {
        max-width: 1400px;
    }
}

/* ============================================================
   TABLET PORTRAIT MODE (specific adjustments)
   ============================================================ */
@media (max-width: 768px) and (orientation: portrait) {
    .nav-pills {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-pills .nav-link {
        font-size: 0.95rem;
    }
}

/* ============================================================
   MOBILE LANDSCAPE MODE (reduce heights)
   ============================================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .brand-header {
        padding: 15px;
    }

    .brand-logo {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }

    .calendar-day {
        min-height: 40px;
        min-width: 40px;
        font-size: 0.9rem;
    }
}

/* ============================================================
   EXTRA SMALL PHONES - 375px and below
   ============================================================ */
@media (max-width: 375px) {
    .main-container {
        margin: 5px;
        padding: 12px;
        border-radius: 10px;
    }

    .brand-header {
        padding: 15px;
        margin-bottom: 15px;
    }

    .brand-logo {
        font-size: 1.8rem;
    }

    .brand-subtitle {
        font-size: 0.9rem;
    }

    .nav-pills {
        flex-direction: column;
    }

    .nav-pills .nav-link {
        margin: 3px 0;
        text-align: center;
        font-size: 0.9rem;
    }

    .stats-card h3 {
        font-size: 1.5rem;
    }

    .employee-card .card-body {
        padding: 12px;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-height: 36px;
    }

    .calendar-day {
        font-size: 0.85rem;
        padding: 8px;
    }

    .calendar-weekday {
        font-size: 0.75rem;
        padding: 8px 3px;
    }

    .salary-filters {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {

    .nav-pills,
    .btn,
    .dropdown,
    .whatsapp-btn {
        display: none !important;
    }

    .main-container {
        box-shadow: none;
        border-radius: 0;
        background: white;
        margin: 0;
        padding: 20px;
    }

    .main-container::before {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .card::before,
    .card::after {
        display: none;
    }

    .table {
        font-size: 11px;
    }

    .brand-header::before {
        display: none;
    }

    .calendar-day {
        border: 1px solid #333;
    }
}

/* ============================================================
   HIGH CONTRAST MODE - Accessibility
   ============================================================ */
@media (prefers-contrast: high) {

    .btn,
    .card,
    .form-control,
    .form-select {
        border: 2px solid currentColor;
    }

    .calendar-day {
        border: 2px solid currentColor;
    }
}

/* ============================================================
   DARK MODE SUPPORT (if needed in future)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    /* Commenting out for now, but structure ready
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 50%, #1a1a1a 100%);
        color: #f5f5f5;
    }

    .main-container {
        background: rgba(44, 44, 44, 0.95);
        border-color: #444;
    }
    */
}
