/* ================================================
   HR MANAGEMENT SYSTEM - CUSTOM STYLES
   ================================================ */

:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --danger-color: #e74a3b;
    --warning-color: #f6c23e;
    --info-color: #36b9cc;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
}

/* ================================================
   LAYOUT
   ================================================ */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, #4e73df 10%, #224abe 100%);
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

main {
    margin-left: 250px;
    padding: 0;
}

.top-row {
    /* background-color: white;
    border-bottom: 1px solid #e3e6f0; */
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.5rem;
    box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}

.content {
    padding: 1.5rem 1.5rem 0 1.5rem;
}

/* ================================================
   SIDEBAR NAVIGATION
   ================================================ */

.sidebar .navbar-brand {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 1rem;
}

.sidebar .navbar-toggler {
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-scrollable {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-item {
    padding: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}
.nav-linkTabs {
    color: rgba(0, 0, 0, 0.8);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    text-decoration:none;
}
    .nav-linkTabs:hover {
        color: #000;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-linkTabs.active {
        color: #fff;
        background-color: var(--primary-color);
    }

    .nav-linkTabs i {
        margin-right: 0.5rem;
        width: 20px;
        text-align: center;
    }

    .nav-link:hover {
        color: white;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-link.active {
        color: white;
        background-color: rgba(255, 255, 255, 0.2);
    }

.nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

.nav-section {
    margin-top: 1rem;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    padding: 0.5rem 1rem;
}

/* ===============================================
   RESPONSIVE & ENHANCED NAVMENU
   ================================================ */

@media (max-width: 767.98px) {
    .sidebar {
        width: 250px;
        transform: translateX(-250px);
        transition: transform 0.3s ease-in-out;
        z-index: 1050;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    main {
        margin-left: 0;
    }

    .mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .mobile-backdrop.show {
        display: block;
    }
}

/* RTL layout adjustments */
[dir="rtl"] .sidebar { left: auto; right: 0; }
[dir="rtl"] main { margin-left: 0; margin-right: 250px; }
[dir="rtl"] .nav-link i { margin-left: 0.5rem; margin-right: 0; }
[dir="rtl"] .nav-linkTabs i { margin-left: 0.5rem; margin-right: 0; }
[dir="rtl"] .top-row { direction: rtl; }
[dir="rtl"] .user-info .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }

/* ===============================================
   PAGE COMPONENTS
   ================================================ */

.page-container {
    padding: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e3e6f0;
}

    .page-header h1 {
        font-size: 1.75rem;
        color: var(--dark-color);
        margin: 0;
    }

.page-title {
    font-size: 1.75rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 767.98px) {
    .page-container {
        padding: 1rem;
    }

    .page-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ================================================
   CARDS
   ================================================ */

.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.75rem 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.card-body {
    padding: 1.25rem;
}

/* ================================================
   STATISTICS CARDS
   ================================================ */

.stat-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stat-icon {
    font-size: 2rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-right: 1rem;
}

.stat-primary .stat-icon {
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
}

.stat-success .stat-icon {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
}

.stat-warning .stat-icon {
    background-color: rgba(246, 194, 62, 0.1);
    color: var(--warning-color);
}

.stat-info .stat-icon {
    background-color: rgba(54, 185, 204, 0.1);
    color: var(--info-color);
}

.stat-danger .stat-icon {
    background-color: rgba(231, 74, 59, 0.1);
    color: var(--danger-color);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--dark-color);
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* ================================================
   DASHBOARD
   ================================================ */

.dashboard {
    padding: 0;
}

.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

    .welcome-card h2 {
        margin: 0;
        font-size: 2rem;
    }

.employee-dashboard .stat-box {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.stat-box h3 {
    margin: 0.5rem 0;
    font-size: 2rem;
    font-weight: bold;
}

.stat-box.stat-success {
    border-left: 4px solid var(--success-color);
}

.stat-box.stat-danger {
    border-left: 4px solid var(--danger-color);
}

.stat-box.stat-warning {
    border-left: 4px solid var(--warning-color);
}

.stat-box.stat-info {
    border-left: 4px solid var(--info-color);
}

.stat-box.stat-secondary {
    border-left: 4px solid var(--secondary-color);
}

/* ================================================
   TABLES
   ================================================ */

.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

    .table thead th {
        background-color: #f8f9fc;
        color: var(--dark-color);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05rem;
        border-bottom: 2px solid #e3e6f0;
        padding: 0.75rem;
    }

    .table tbody tr {
        transition: all 0.3s;
    }

.table-hover tbody tr:hover {
    background-color: #f8f9fc;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    font-weight: 600;
    border-radius: 0.35rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background-color: #2e59d9;
        border-color: #2e59d9;
        transform: translateY(-2px);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-group .btn {
    margin: 0;
}

/* ================================================
   FORMS
   ================================================ */

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    }

.input-group-text {
    background-color: #f8f9fc;
    border: 1px solid #d1d3e2;
}

/* ================================================
   BADGES
   ================================================ */

.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    border-radius: 0.35rem;
}

/* ================================================
   LOGIN PAGE
   ================================================ */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--company-primary-500, #667eea) 0%, var(--company-secondary-500, #764ba2) 100%);
    font-family: var(--company-font-family, inherit);
}

.login-box {
    background: var(--company-card-bg, white);
    border: var(--company-card-border-width, 0) solid var(--company-card-border, #e5e7eb);
    border-radius: var(--company-card-radius, 1rem);
    box-shadow: var(--company-card-shadow, 0 1rem 3rem rgba(0, 0, 0, 0.3));
    padding: var(--company-card-padding, 3rem);
    width: 100%;
    max-width: 450px;
    color: var(--company-text-color, inherit);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header i {
        color: var(--company-primary-500, var(--primary-color));
    }

    .login-header h2 {
        margin: 1rem 0 0.5rem;
        color: var(--company-text-color, var(--dark-color));
    }

.login-footer {
    text-align: center;
    margin-top: 1rem;
}

/* ================================================
   EMPLOYEE COMPONENTS
   ================================================ */

.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

    .employee-avatar img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
    }

    .employee-avatar i {
        color: var(--secondary-color);
    }

/* ================================================
   LEAVE COMPONENTS
   ================================================ */

.leave-balance-item {
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
}

    .leave-balance-item:last-child {
        border-bottom: none;
    }

.leave-requests-list {
    max-height: 400px;
    overflow-y: auto;
}

.leave-request-item {
    padding: 1rem;
    border-bottom: 1px solid #e3e6f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .leave-request-item:hover {
        background-color: #f8f9fc;
    }

    .leave-request-item .employee-name {
        font-weight: 600;
        color: var(--dark-color);
    }

    .leave-request-item .leave-details {
        display: flex;
        justify-content: space-between;
        margin-top: 0.25rem;
    }

.guidelines-list {
    list-style: none;
    padding: 0;
}

    .guidelines-list li {
        padding: 0.5rem 0;
        border-left: 3px solid var(--primary-color);
        padding-left: 1rem;
        margin-bottom: 0.5rem;
        background-color: #f8f9fc;
    }

/* ================================================
   DEPARTMENT COMPONENTS
   ================================================ */

.department-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

    .department-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.3);
    }

.department-stats {
    margin-top: 1rem;
}

    .department-stats .stat-item {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
        color: var(--secondary-color);
    }

        .department-stats .stat-item i {
            margin-right: 0.5rem;
            color: var(--primary-color);
        }

/* ================================================
   COMPANY COMPONENTS
   ================================================ */

.company-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

    .company-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.3);
    }

.company-stats {
    margin-top: 1rem;
}

    .company-stats .stat-item {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
        color: var(--secondary-color);
    }

        .company-stats .stat-item i {
            margin-right: 0.5rem;
            color: var(--primary-color);
        }

/* ================================================
   JOB POSTING COMPONENTS
   ================================================ */

.job-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

    .job-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.3);
    }

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

    .job-meta .meta-item {
        display: flex;
        align-items: center;
        color: var(--secondary-color);
        font-size: 0.875rem;
    }

        .job-meta .meta-item i {
            margin-right: 0.5rem;
            color: var(--primary-color);
        }

.job-stats {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e3e6f0;
}

    .job-stats .stat {
        display: flex;
        align-items: center;
        color: var(--secondary-color);
        font-size: 0.875rem;
    }

        .job-stats .stat i {
            margin-right: 0.5rem;
        }

/* ================================================
   PAYROLL COMPONENTS
   ================================================ */

.payroll-summary {
    display: flex;
    justify-content: space-around;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

    .payroll-summary .summary-item {
        text-align: center;
    }

    .payroll-summary h5 {
        font-size: 0.875rem;
        opacity: 0.9;
        margin-bottom: 0.5rem;
    }

    .payroll-summary h3 {
        font-size: 1.75rem;
        font-weight: bold;
    }

.payslip {
    background: white;
}

    .payslip .card-header {
        background: var(--primary-color);
        color: white;
    }

.net-pay-section {
    background-color: #f8f9fc;
    padding: 1.5rem;
    margin-top: 2rem;
    border-radius: 0.5rem;
    border: 2px solid var(--success-color);
}

/* ================================================
   USER INFO
   ================================================ */

.user-info {
    display: flex;
    align-items: center;
}

    .user-info i {
        color: var(--primary-color);
    }

    .user-info span {
        color: var(--dark-color);
        font-weight: 600;
    }

/* ================================================
   ALERTS
   ================================================ */

.alert {
    border-radius: 0.5rem;
    border: none;
}

    .alert i {
        margin-right: 0.5rem;
    }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }

    main {
        margin-left: 0;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .page-header .header-actions {
            margin-top: 1rem;
            width: 100%;
        }

    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ================================================
   UTILITIES
   ================================================ */

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* ================================================
   BLAZORED MODAL OVERRIDES
   ================================================ */

.blazored-modal-container {
    z-index: 1060 !important; /* Ensure it's above the mobile backdrop */
}

.blazored-modal {
    max-width: 500px;
    margin: 1.75rem auto;
}

@media (max-width: 576px) {
    .blazored-modal {
        margin: 0.5rem;
        width: auto;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    .sidebar,
    .top-row,
    .page-header,
    .btn,
    .card-footer {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }

    .payslip {
        box-shadow: none !important;
    }
}
