/* Base Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: bold;
}

.btn:hover {
    background-color: #2980b9;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Login Page */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-box {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #00094f;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}


/* Dashboard Layout */

.dashboard {
    display: flex;
    min-height: 100vh;
}


/* Enhanced Sidebar Styles - Fixed Position for Non-Scroll Behavior */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e2a44 0%, #0f172a 100%);
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.sidebar-header h2 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar ul {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

.sidebar li {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar li a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #cbd5e1;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar li a i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar li a:hover {
    background: #2563eb;
    color: white;
    padding-left: 25px;
}

.sidebar li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: #3b82f6;
    transition: width 0.3s ease;
}

.sidebar li a:hover::before {
    width: 5px;
}

.sidebar li.active a {
    background: #2563eb;
    color: white;
    padding-left: 25px;
}

.sidebar li.active a::before {
    width: 5px;
    background: #3b82f6;
}


/* Adjust Main Content to Account for Fixed Sidebar */

.main-content {
    flex: none;
    width: calc(100% - 260px);
    margin-left: 260px;
    padding: 25px;
    background-color: #f9f9f9;
    transition: margin-left 0.3s ease, width 0.3s ease;
}


/* Mobile Toggle Button */

.mobile-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* Stats Cards */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 16px;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}


/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status.approved {
    background-color: #d4edda;
    color: #155724;
}

.status.rejected {
    background-color: #f8d7da;
    color: #721c24;
}


/* Leave Balance Cards */

.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.balance-card {
    padding: 20px;
    border-radius: 8px;
    color: white;
}

.balance-card h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.balance-card p {
    font-size: 24px;
    font-weight: bold;
}

.balance-card.sick {
    background-color: #e74c3c;
}

.balance-card.normal {
    background-color: #3498db;
}

.balance-card.emergency {
    background-color: #f39c12;
}

.balance-card.wfh {
    background-color: #e95843c5;
}

.attendance-section,
.leave-balance,
.recent-attendance {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.btn {
    padding: 8px 15px;
    background-color: #f3a31d;
    color: #00094f;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.status.present {
    background-color: #28a745;
    color: white;
}

.status.absent {
    background-color: #dc3545;
    color: white;
}

.status.late {
    background-color: #ffc107;
    color: #212529;
}

.status.half-day {
    background-color: #fd7e14;
    color: white;
}


/* Upcoming Holidays */

.upcoming-holidays {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.upcoming-holidays h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.holiday-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.holiday-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #fff;
    border-left: 4px solid #4CAF50;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.holiday-item:hover {
    transform: scale(1.02);
}

.holiday-date {
    width: 70px;
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
    text-align: center;
}

.holiday-details {
    flex-grow: 1;
    padding-left: 15px;
}

.holiday-details h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.recurring {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 8px;
    font-size: 12px;
    color: #fff;
    background-color: #007BFF;
    border-radius: 4px;
}


/* Custom Scrollbar for Sidebar */

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e2a44;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}


/* Mobile Responsiveness */

@media (max-width: 768px) {
    .login-container {
        padding: 20px;
    }
    .login-box {
        width: 100%;
        padding: 20px;
    }
    .dashboard {
        position: relative;
        flex-direction: column;
    }
    .sidebar {
        width: 260px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 60px 15px 15px 15px;
        transition: none;
    }
    .mobile-toggle {
        display: block;
    }
    .stats-container,
    .balance-cards {
        grid-template-columns: 1fr;
    }
    table {
        display: block;
        overflow-x: auto;
    }
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 10px;
    }
    .btn {
        padding: 8px 15px;
    }
    .modal-content {
        width: 95%;
        margin: 10px auto;
    }
}