/* Custom CSS for HR Portal */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 280px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Forms */
.form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #d1ecf1;
    color: #055160;
}

/* Dashboard Cards */
.dashboard-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    border: none;
}

.dashboard-card .card-body {
    padding: 2rem;
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-left: 4px solid var(--primary-color);
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Leave Status Badges */
.badge-pending {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-approved {
    background-color: var(--success-color);
}

.badge-rejected {
    background-color: var(--danger-color);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 10px;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-card h3 {
        font-size: 2rem;
    }
    
    .stats-card .stats-number {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Sidebar Styles */
.offcanvas {
    width: var(--sidebar-width) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1050 !important;
}

/* Ensure sidebar is above backdrop */
.offcanvas-backdrop {
    z-index: 1040 !important;
}


.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 1 !important;
}

.offcanvas-header .offcanvas-title a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.offcanvas-header .offcanvas-title a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.offcanvas-body {
    opacity: 1 !important;
}

.offcanvas-body .nav-link {
    color: var(--dark-color);
    transition: all 0.3s ease;
    border-radius: 0;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
}

.offcanvas-body .nav-link:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding-left: 1.5rem;
    text-decoration: none;
    transform: translateX(5px);
}

.offcanvas-body .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.offcanvas-body .nav-link.active:hover {
    background-color: var(--primary-color);
    color: white;
    transform: none;
    padding-left: 1rem;
}

.offcanvas-body .nav-link:focus {
    box-shadow: none;
    outline: none;
}

.offcanvas-body .nav-link i {
    width: 20px;
    text-align: center;
}

/* Sidebar toggle button */
.navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.navbar .btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.4);
}

/* Main content adjustment */
.main-content {
    transition: margin-left 0.3s ease;
}

/* Desktop sidebar improvements */
@media (min-width: 769px) {
    .offcanvas {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1040;
    }
    
    .offcanvas.show {
        transform: translateX(0);
    }
    
    .offcanvas-body .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .offcanvas-body .nav-link:hover {
        transform: translateX(5px);
    }
    
    .offcanvas-body .nav-link.active:hover {
        transform: none;
    }
    
    .offcanvas-body .nav-link.active {
        border-left: 3px solid white;
    }
    
    .offcanvas-body .nav-link.active i {
        color: white;
    }
    
    .offcanvas-body .nav-link i {
        transition: color 0.3s ease;
    }
    
    .offcanvas-body .nav-link:hover i {
        color: var(--primary-color);
    }
    
    .offcanvas-body .nav-link.active:hover i {
        color: white;
    }
    
    .offcanvas-body .nav-link.active:hover {
        background-color: var(--primary-color);
        color: white;
        border-left: 3px solid white;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    }
}

/* Mobile sidebar improvements */
@media (max-width: 768px) {
    .offcanvas {
        width: 100% !important;
    }
    
    .offcanvas-body .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .offcanvas-body .nav-link:hover {
        transform: none;
        padding-left: 1rem;
    }
}

/* Print styles */
@media print {
    .navbar, .btn, .modal, footer, .offcanvas {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}
