/* HRM Portal - Custom Styles */

: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;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px;
    /* Height of navbar */
    left: 0;
    width: 250px;
    height: calc(100vh - 56px);
    background-color: #2c3e50;
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
    left: -250px;
}

.sidebar-header {
    padding: 20px;
    background-color: #34495e;
    border-bottom: 1px solid #1a252f;
}

.sidebar-header h5 {
    color: #ecf0f1;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    border-bottom: 1px solid #34495e;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    background-color: #34495e;
    color: #3498db;
    padding-left: 25px;
}

.sidebar-link.active {
    background-color: #3498db;
    color: #fff;
    border-left: 4px solid #2980b9;
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 25px;
    text-align: center;
}

.sidebar-link span {
    font-size: 0.95rem;
}

/* Main Content Wrapper */
.main-content {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
    padding-top: 56px;
    /* Height of fixed navbar */
    min-height: 100vh;
}

.main-content.sidebar-open {
    margin-left: 0;
}

/* Navbar Adjustments */
.navbar.fixed-top {
    z-index: 1030;
}

#sidebarToggle {
    border: none;
    font-size: 1.5rem;
    padding: 5px 10px;
}

#sidebarToggle:hover {
    background-color: #0056b3 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.sidebar-open {
        margin-left: 0;
    }
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #2c3e50;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #4a5f7f;
}


/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-page .card {
    border: none;
    border-radius: 15px;
}

.login-page .card-body {
    border-radius: 15px;
}

.login-page .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.login-page .form-control {
    border-left: none;
}

.login-page .form-control:focus {
    border-color: #ced4da;
    box-shadow: none;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

/* Stats Cards */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a .stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

.stats-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .15);
}

.btn-sm {
    padding: 0.25rem 0.8rem;
    font-size: 0.875rem;
}

/* Tables */
.table {
    background-color: white;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    border: 1px solid #ced4da;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    border-radius: 6px;
}

/* Forms */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.6rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.form-section h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Filter Sidebar */
.filter-sidebar {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-sidebar h5 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* Custom scrollbar for filter sidebar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal */
.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-content {
    border-radius: 10px;
    border: none;
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 2rem;
    }

    .filter-sidebar {
        position: static;
        margin-bottom: 1.5rem;
    }

    .table {
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.shadow-sm-custom {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.rounded-custom {
    border-radius: 10px;
}