/* Enhanced styles for employee detail page */
.employee-info-table {
    border: none;
    margin-bottom: 0;
}

.employee-info-table th,
.employee-id-table th {
    background-color: var(--primary) !important;
    color: var(--white);
    font-family: Georgia, 'Times New Roman', Times, serif;
    border: 1px solid var(--primary-dark);
    vertical-align: middle;
}

.employee-info-table td,
.employee-id-table td {
    border: 1px solid var(--border-color);
    vertical-align: middle;
}

.employee-id-table {
    margin-bottom: 0;
}

/* Employee Leave Card styling */
.card-header h2 {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* New compact styling for employee information */
.employee-leave-card {
    padding: 0.25rem;
}

.info-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 0.1rem;
    background-color: var(--primary-light);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.info-value {
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

/* Leaves records table styling */
.leave-records-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}

.leave-records-table th,
.leave-records-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    vertical-align: middle;
}

.leave-records-table thead th {
    font-weight: 600;
    text-align: center;
    background-color: var(--primary) !important;
    color: var(--white);
    white-space: nowrap;
    border: 1px solid var(--primary-dark);
}

.leave-records-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.leave-records-table tbody tr:hover {
    background-color: var(--highlight);
}

/* Special styling for different row types */
.table-secondary {
    background-color: #e2e3e5 !important;
}

.balance-only-row td {
    border-top: none !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.balance-only-row td:nth-child(1),
.balance-only-row td:nth-child(2),
.balance-only-row td:nth-child(3),
.balance-only-row td:nth-child(4),
.balance-only-row td:nth-child(5),
.balance-only-row td:nth-child(7),
.balance-only-row td:nth-child(8),
.balance-only-row td:nth-child(9),
.balance-only-row td:nth-child(11) {
    border: none;
    background-color: transparent;
}

.fw-bold {
    font-weight: bold;
}

/* Card styling for leave records */
.card-header p {
    margin-top: -5px;
}

/* Search feature styling */
.leave-filter-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.leave-filter-buttons .btn {
    margin: 0 0.125rem;
    font-weight: 600;
}

.filter-btn.active {
    box-shadow: 0 0 0 0.15rem rgba(42, 157, 90, 0.4);
}

.highlight {
    background-color: #ffeb3b;
    font-weight: bold;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

#leaveSearchStatus {
    font-weight: 600;
}

/* Mobile responsive table */
@media (max-width: 992px) {
    .leave-records-table {
        font-size: 0.8rem;
    }

    .leave-filter-buttons {
        margin-top: 0.5rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .leave-filter-buttons .btn {
        margin: 0.125rem;
    }
}

@media (max-width: 576px) {
    .leave-records-table {
        width: 900px;
    }
}

/* Employee Detail Page Specific Styles */

/* Table styling */
.leave-records-table thead {
    background-color: #1e6f42 !important;
    /* Dark green header */
    color: white !important;
}

.leave-records-table thead th {
    font-weight: 600;
    vertical-align: middle;
}

.table-dark-green {
    background-color: #1e6f42 !important;
    color: white !important;
}

/* Card styling */
.employee-leave-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 1rem;
}

/* Year separator styling */
.year-separator td {
    font-weight: bold;
    background-color: #0d6efd !important;
    /* Primary blue */
    color: white !important;
    border-radius: 0.25rem;
}

/* Filter button styling */
.filter-btn.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

/* Search result highlight */
.highlight {
    background-color: yellow;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
    font-weight: bold;
}

/* Balance row styling */
.balance-only-row {
    background-color: #f8f9fa;
    font-weight: 500;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .leave-filter-buttons {
        justify-content: center;
        margin-top: 1rem;
    }

    .info-label,
    .info-value {
        font-size: 0.9rem;
    }

    /* Make filters smaller and more compact on mobile */
    .input-group-lg select.form-select,
    .input-group-lg .input-group-text {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    .col-md-3 {
        padding: 0 4px;
        margin-bottom: 8px;
    }

    .input-group-lg .input-group-text {
        white-space: nowrap;
        overflow: hidden;
    }

    /* Improve filter layout on mobile */
    .row .col-md-3 {
        padding-left: 5px;
        padding-right: 5px;
    }

    .input-group {
        margin-bottom: 8px;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .leave-records-table {
        width: 900px;
    }

    /* Make filter controls even smaller and stack them better */
    .row .col-md-3 {
        width: 100%;
        margin-bottom: 6px;
    }

    .input-group-lg select.form-select,
    .input-group-lg .input-group-text {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Make the dropdown text shorter to prevent overflow */
    .input-group-lg .input-group-text {
        width: 50px;
    }

    /* Abbreviate filter labels on small screens */
    .input-group-text[for="yearSelect"],
    .input-group-text[for="monthSelect"],
    .input-group-text[for="quarterSelect"] {
        font-size: 0.7rem;
    }

    /* Smaller selection text */
    select.form-select {
        font-size: 0.7rem;
    }
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    .table-dark-green {
        background-color: #1e6f42 !important;
        color: white !important;
    }

    .year-separator td {
        background-color: #0d6efd !important;
        color: white !important;
    }

    .highlight {
        background-color: #ffc107;
        color: black;
    }

    .balance-only-row {
        background-color: #343a40;
    }
}

/* Add spacing between filter buttons and reduce year dropdown size */
.filter-btn {
    margin: 0 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-width: 1.5px;
}

/* Smaller year dropdown */
.input-group-lg select.form-select {
    height: auto;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    border-radius: 0 1rem 1rem 0 !important;
}

.input-group-lg .input-group-text {
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    border-radius: 1rem 0 0 1rem !important;
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 500;
}

/* Dark mode styling for year dropdown */
[data-theme="dark"] .input-group-lg .input-group-text {
    background-color: #1e3d2c;
    border-color: #1e3d2c;
}

[data-theme="dark"] .input-group-lg select.form-select {
    background-color: #2c2c2c;
    border-color: #444;
    color: #e0e0e0;
}

/* Ensure filter buttons look consistent */
.filter-btn.active {
    box-shadow: 0 0 0 0.15rem rgba(42, 157, 90, 0.4);
}