/* Poppins font - Local hosted */
@import url('../vendor/fonts/poppins/poppins.css');

/* --- Variable Definitions --- */
:root {
    --primary-color: #0d6efd; /* Professional Blue */
    --primary-hover: #0b5ed7;
    --sidebar-bg: #ffffff; /* White Sidebar */
    --sidebar-link-color: #495057;
    --sidebar-link-hover-bg: #f1f5f9;
    --sidebar-link-active-color: #0d6efd;
    --navbar-bg: #0d6efd; /* Blue Navbar */
    --body-bg: #f8f9fa;
    --text-color: #212529;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --card-border-radius: 1rem;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --muted-text: #6c757d;
}

/* --- Color Theme: Green --- */
body.theme-green {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --sidebar-link-active-color: #10b981;
    --navbar-bg: #10b981;
}

/* --- Color Theme: Navy Blue --- */
body.theme-navy {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --sidebar-link-active-color: #1e40af;
    --navbar-bg: #1e40af;
}

/* --- Color Theme: Purple --- */
body.theme-purple {
    --primary-color: #9333ea;
    --primary-hover: #7e22ce;
    --sidebar-link-active-color: #9333ea;
    --navbar-bg: #9333ea;
}

/* --- Color Theme: Orange --- */
body.theme-orange {
    --primary-color: #ea580c;
    --primary-hover: #c2410c;
    --sidebar-link-active-color: #ea580c;
    --navbar-bg: #ea580c;
}

/* --- Color Theme: Red --- */
body.theme-red {
    --primary-color: #dc2626;
    --primary-hover: #b91c1c;
    --sidebar-link-active-color: #dc2626;
    --navbar-bg: #dc2626;
}

/* --- Color Theme: Teal --- */
body.theme-teal {
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --sidebar-link-active-color: #0d9488;
    --navbar-bg: #0d9488;
}

/* --- Base Styles --- */
body {
    background-color: var(--body-bg);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    font-size: 14px; /* Reduced by 2px from default 16px */
}

/* --- Sidebar & Navigation --- */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 16.66667%; /* Equivalent to col-lg-2 in Bootstrap */
    min-width: 200px;
    max-width: 280px;
    height: calc(100vh - 56px);
    background-color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1030;
}

.sidebar .nav-link {
    color: var(--sidebar-link-color);
    padding: 12px 20px;
    border-radius: 12px;
    margin: 4px 0;
    transition: all 0.3s ease-in-out;
    font-weight: 500;
    font-size: 16px; /* Restore original font size for sidebar menu */
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: transparent !important;
    color: var(--sidebar-link-active-color) !important;
    font-weight: 600;
}

.sidebar .nav-link.active i {
    color: var(--sidebar-link-active-color) !important;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    color: #6c757d;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--navbar-bg) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1040;
}

.navbar .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
}

.navbar .nav-link {
     color: rgba(255, 255, 255, 0.95) !important;
     transition: all 0.3s ease;
}

.navbar .nav-link:hover {
     color: #ffffff !important;
}

.navbar .dropdown-menu {
     background-color: #ffffff;
     border: 1px solid var(--border-color);
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar .dropdown-item {
     color: #212529 !important;
     transition: all 0.3s ease;
}

.navbar .dropdown-item:hover {
     background-color: #f8f9fa;
     color: var(--primary-color) !important;
}

.navbar .badge {
     background-color: rgba(255, 255, 255, 0.25) !important;
     color: #ffffff !important;
     border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Card Styles --- */
.card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.25rem;
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* --- Button Styles --- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

/* --- Table Styles --- */
.table {
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-color);
    background-color: transparent;
}

.table thead th {
    border-bottom-width: 1px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--muted-text);
    border-color: var(--border-color);
    background-color: #f8f9fa;
}

.table td, .table th {
    vertical-align: middle;
    padding: 1rem;
    border-color: var(--border-color);
    color: var(--text-color);
}

.table-hover tbody tr:hover {
    background-color: var(--sidebar-link-hover-bg);
}

/* --- Dashboard Specific --- */
.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--card-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card h3 {
    font-weight: 700;
}

/* Theme Toggle Button */
.theme-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Theme Card Styling */
.theme-card {
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.theme-card .theme-preview {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Form inputs styling */
.form-control, .form-select {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border);
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 14px; /* Reduced by 2px */
}

.form-label {
    font-size: 14px; /* Reduced by 2px */
}

.form-control::placeholder {
    color: var(--muted-text);
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    color: var(--text-color);
}

/* Modal styling */
.modal-content {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    font-size: 14px; /* Reduced by 2px */
}

.modal-header, .modal-footer {
    border-color: var(--border-color);
    color: var(--text-color);
}

.modal-body {
    color: var(--text-color);
    font-size: 14px; /* Reduced by 2px */
}

.modal-title {
    font-size: 18px; /* Reduced by 2px from default 20px */
}

/* Alert styling */
.alert {
    background-color: #ffffff !important;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

/* --- Employee Selection Cards --- */
/* Horizontal card layout (Edit Timesheet) */
.employee-select-card {
    position: relative;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: block;
}

.employee-select-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.employee-select-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Horizontal card selected state */
.employee-select-checkbox:checked + .employee-select-card {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: var(--primary-color);
}

.employee-select-checkbox:checked + .employee-select-card .employee-select-icon {
    background-color: var(--primary-color);
    color: #ffffff;
}

.employee-select-checkbox:checked + .employee-select-card .employee-select-check {
    opacity: 1;
    transform: scale(1);
}

/* Vertical card selected state */
.employee-select-checkbox:checked + .employee-select-label {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: var(--primary-color);
}

.employee-select-checkbox:checked + .employee-select-label .employee-select-icon {
    background-color: var(--primary-color);
    color: #ffffff;
}

.employee-select-checkbox:checked + .employee-select-label .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Vertical card layout (Add Timesheet Modal) */
.employee-select-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    margin: 0;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
}

.employee-select-label:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.employee-select-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f8f9fa;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.employee-code {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 4px;
}

.employee-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.employee-ird {
    font-size: 12px;
    color: var(--muted-text);
}

.employee-ird i {
    font-size: 11px;
}

.employee-rate {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

/* Check icon for vertical cards */
.check-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

/* Check icon for horizontal cards */
.employee-select-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.employee-select-checkbox:checked + .employee-select-card .employee-select-check {
    opacity: 1;
    transform: scale(1);
}

/* --- Main Content Area --- */
.main-content {
    margin-top: 56px;
    margin-left: 16.66667%; /* Equivalent to col-lg-2 in Bootstrap */
    padding: 2rem;
    min-height: calc(100vh - 56px);
    width: 83.33333%; /* Equivalent to col-lg-10 in Bootstrap */
}

/* --- Badge Styles --- */
.badge,
span.badge,
.badge.bg-success,
.badge.bg-dark,
.badge.bg-warning,
.badge.bg-secondary,
.badge.bg-danger,
.badge.bg-info,
.badge.bg-light,
.badge.bg-primary {
    font-weight: 400 !important; /* Regular font weight for all badges */
}

/* Ensure proper text color for dark badges */
.badge.bg-dark {
    color: #ffffff !important;
}

/* Ensure proper text color for warning badges (yellow background needs dark text) */
.badge.bg-warning {
    color: #000000 !important;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        min-width: auto;
        max-width: none;
        height: auto;
        margin-top: 56px;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 0;
        padding: 1rem;
        width: 100%;
    }
    
    .navbar {
        position: fixed;
    }
    
    body {
        padding-top: 56px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        min-height: auto;
    }
    
    .main-content {
        padding: 1rem;
    }
}
