/* Custom styles for EvoHR */

/* Card styles with colored left borders */
.card.border-left-primary {
    border-left: 0.25rem solid var(--bs-primary) !important;
}

.card.border-left-success {
    border-left: 0.25rem solid var(--bs-success) !important;
}

.card.border-left-info {
    border-left: 0.25rem solid var(--bs-info) !important;
}

.card.border-left-warning {
    border-left: 0.25rem solid var(--bs-warning) !important;
}

.card.border-left-danger {
    border-left: 0.25rem solid var(--bs-danger) !important;
}

/* Text colors */
.text-gray-300 {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* Chart container */
.chart-pie {
    position: relative;
}

/* Leave calendar styles */
.calendar-day {
    position: relative;
    height: 100px;
}

.calendar-day .date {
    font-weight: bold;
    font-size: 1.2rem;
}

.calendar-day .events {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
}

.calendar-day .event {
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Employee profile styles */
.profile-header {
    position: relative;
    background-color: var(--bs-dark-bg-subtle);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.profile-cover {
    height: 150px;
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--bs-dark);
    border: 5px solid var(--bs-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: absolute;
    top: 90px;
    left: 30px;
}

.profile-info {
    padding: 20px 20px 20px 170px;
}

.profile-nav {
    padding: 0 20px 20px 170px;
}

/* Payslip styles */
.payslip {
    background-color: white;
    color: black;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.payslip-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
    margin-bottom: 1.5rem;
}

.payslip-company {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.payslip-title {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.payslip-section {
    margin-bottom: 1.5rem;
}

.payslip-section-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.payslip-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #eee;
    text-align: center;
}

/* Login and Reset Password Form Styles */
.login-card, .reset-card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.login-header, .reset-header {
    padding: 2rem 1.5rem;
}

.login-form, .reset-form {
    padding: 2rem;
}

.login-footer {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.03);
}

.brand-logo {
    max-height: 60px;
    margin-bottom: 1rem;
}

.forgot-password {
    text-align: right;
}

.back-to-login {
    margin-top: 1.5rem;
    text-align: center;
}

.password-requirements {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Make placeholder text more visible */
::placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
}

/* Make action button text white */
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info,
a.btn-primary, a.btn-success, a.btn-danger, a.btn-warning, a.btn-info,
button.btn-primary, button.btn-success, button.btn-danger, button.btn-warning, button.btn-info,
input.btn-primary, input.btn-success, input.btn-danger, input.btn-warning, input.btn-info,
.datatable .btn-primary, .datatable .btn-success, .datatable .btn-danger, .datatable .btn-warning, .datatable .btn-info,
.table .btn-primary, .table .btn-success, .table .btn-danger, .table .btn-warning, .table .btn-info,
.card .btn-primary, .card .btn-success, .card .btn-danger, .card .btn-warning, .card .btn-info,
.modal .btn-primary, .modal .btn-success, .modal .btn-danger, .modal .btn-warning, .modal .btn-info,
.dropdown-item .btn-primary, .dropdown-item .btn-success, .dropdown-item .btn-danger, .dropdown-item .btn-warning, .dropdown-item .btn-info,
.action-buttons .btn-primary, .action-buttons .btn-success, .action-buttons .btn-danger, .action-buttons .btn-warning, .action-buttons .btn-info,
.btn-group .btn-primary, .btn-group .btn-success, .btn-group .btn-danger, .btn-group .btn-warning, .btn-group .btn-info,
.navbar .btn-primary, .navbar .btn-success, .navbar .btn-danger, .navbar .btn-warning, .navbar .btn-info,
.approval-history .btn-primary, .approval-history .btn-success, .approval-history .btn-danger, .approval-history .btn-warning, .approval-history .btn-info,
.history-action .btn-primary, .history-action .btn-success, .history-action .btn-danger, .history-action .btn-warning, .history-action .btn-info,
.history-actions .btn-primary, .history-actions .btn-success, .history-actions .btn-danger, .history-actions .btn-warning, .history-actions .btn-info,
/* Additional selectors for specific button types */
.btn-view, .btn-edit, .btn-delete, .btn-approve, .btn-reject, .btn-history, .btn-download,
a.btn-view, a.btn-edit, a.btn-delete, a.btn-approve, a.btn-reject, a.btn-history, a.btn-download {
    color: white !important;
    text-decoration: none !important;
}

/* Make sure action buttons maintain white text on hover, focus and active states */
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover, .btn-info:hover,
.btn-primary:focus, .btn-success:focus, .btn-danger:focus, .btn-warning:focus, .btn-info:focus,
.btn-primary:active, .btn-success:active, .btn-danger:active, .btn-warning:active, .btn-info:active,
a.btn-primary:hover, a.btn-success:hover, a.btn-danger:hover, a.btn-warning:hover, a.btn-info:hover,
a.btn-primary:focus, a.btn-success:focus, a.btn-danger:focus, a.btn-warning:focus, a.btn-info:focus,
a.btn-primary:active, a.btn-success:active, a.btn-danger:active, a.btn-warning:active, a.btn-info:active,
button.btn-primary:hover, button.btn-success:hover, button.btn-danger:hover, button.btn-warning:hover, button.btn-info:hover,
button.btn-primary:focus, button.btn-success:focus, button.btn-danger:focus, button.btn-warning:focus, button.btn-info:focus,
button.btn-primary:active, button.btn-success:active, button.btn-danger:active, button.btn-warning:active, button.btn-info:active,
.dropdown-menu .btn-primary, .dropdown-menu .btn-success, .dropdown-menu .btn-danger, .dropdown-menu .btn-warning, .dropdown-menu .btn-info,
.dropdown-item .btn-primary:hover, .dropdown-item .btn-success:hover, .dropdown-item .btn-danger:hover, .dropdown-item .btn-warning:hover, .dropdown-item .btn-info:hover,
.action-buttons .btn-primary:hover, .action-buttons .btn-success:hover, .action-buttons .btn-danger:hover, .action-buttons .btn-warning:hover, .action-buttons .btn-info:hover,
.btn-group .btn-primary:hover, .btn-group .btn-success:hover, .btn-group .btn-danger:hover, .btn-group .btn-warning:hover, .btn-group .btn-info:hover,
.navbar .btn-primary:hover, .navbar .btn-success:hover, .navbar .btn-danger:hover, .navbar .btn-warning:hover, .navbar .btn-info:hover,
.table .btn-primary:hover, .table .btn-success:hover, .table .btn-danger:hover, .table .btn-warning:hover, .table .btn-info:hover,
.approval-history .btn-primary:hover, .approval-history .btn-success:hover, .approval-history .btn-danger:hover, .approval-history .btn-warning:hover, .approval-history .btn-info:hover,
.history-action .btn-primary:hover, .history-action .btn-success:hover, .history-action .btn-danger:hover, .history-action .btn-warning:hover, .history-action .btn-info:hover,
.history-actions .btn-primary:hover, .history-actions .btn-success:hover, .history-actions .btn-danger:hover, .history-actions .btn-warning:hover, .history-actions .btn-info:hover,
.btn-view:hover, .btn-edit:hover, .btn-delete:hover, .btn-approve:hover, .btn-reject:hover, .btn-history:hover, .btn-download:hover,
a.btn-view:hover, a.btn-edit:hover, a.btn-delete:hover, a.btn-approve:hover, a.btn-reject:hover, a.btn-history:hover, a.btn-download:hover,
/* Hover states for leave page history button */
.btn.btn-history:hover, .btn.btn-history:focus, .btn.btn-history:active,
a.btn.btn-history:hover, a.btn.btn-history:focus, a.btn.btn-history:active,
.btn.btn-sm.btn-history:hover, .btn.btn-sm.btn-history:focus, .btn.btn-sm.btn-history:active,
a.btn.btn-sm.btn-history:hover, a.btn.btn-sm.btn-history:focus, a.btn.btn-sm.btn-history:active,
a[href*="/leave/history/"]:hover, a[href*="/leave/history/"]:focus, a[href*="/leave/history/"]:active,
.table .btn.btn-history:hover, .table .btn.btn-history:focus, .table .btn.btn-history:active,
.leave-history-btn:hover, .leave-history-btn:focus, .leave-history-btn:active,
.btn-secondary.btn-history:hover, .btn-secondary.btn-history:focus, .btn-secondary.btn-history:active,
.btn[title*="History"]:hover, .btn[title*="History"]:focus, .btn[title*="History"]:active,
.table .btn.btn-secondary:hover, .table .btn.btn-secondary:focus, .table .btn.btn-secondary:active,
a.btn.btn-secondary:hover, a.btn.btn-secondary:focus, a.btn.btn-secondary:active,
.history-btn:hover, .history-btn:focus, .history-btn:active {
    color: white !important;
}

/* Explicitly set all history table elements to use white text on colored buttons */
.approval-history td a.btn,
.approval-history td button.btn,
.history-table td a.btn,
.history-table td button.btn,
.leave-history td a.btn,
.leave-history td button.btn,
.attendance-history td a.btn,
.attendance-history td button.btn,
.payroll-history td a.btn,
.payroll-history td button.btn,
/* Target any button with action-specific class in tables */
table td a.btn-primary, 
table td a.btn-success, 
table td a.btn-danger, 
table td a.btn-warning, 
table td a.btn-info,
table td a.btn-view, 
table td a.btn-edit, 
table td a.btn-delete, 
table td a.btn-approve, 
table td a.btn-reject, 
table td a.btn-history, 
table td a.btn-download,
/* Target specific problem areas */
.btn.btn-history,
a.btn.btn-history,
.btn.btn-sm.btn-history,
a.btn.btn-sm.btn-history,
a[href*="/leave/history/"],
.table .btn.btn-history,
.leave-history-btn,
.btn-secondary.btn-history,
.btn[title*="History"],
.table .btn.btn-secondary,
a.btn.btn-secondary,
.history-btn,
.btn-default.btn-history,
a.btn-default.btn-history,
.btn.btn-default.btn-history,
a.btn.btn-default.btn-history,
/* Target the specific leave page button */
a.btn.btn-sm.btn-secondary,
.leave-page a.btn,
.actions-column a.btn,
a.btn[href*="/leave/history"] {
    color: white !important;
    text-decoration: none !important;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .sidebar.sidebar-collapsed {
        margin-left: 0;
        width: 70px; /* adjust to your collapsed width */
    }
    
    .sidebar-collapsed ~ .content-wrapper,
    .sidebar-collapsed ~ .top-navbar {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        top: 110px;
        left: 20px;
    }
    
    .profile-info, .profile-nav {
        padding-left: 20px;
    }
    
    .profile-nav {
        padding-top: 40px;
    }
    
    .sidebar {
        margin-left: -250px;
        transition: margin-left 0.3s ease;
    }
    
    .sidebar.show {
        margin-left: 0 !important;
    }
    
    /* backdrop is the next sibling */
    .sidebar + .sidebar-backdrop {
        display: none;
    }
    
    .sidebar.show + .sidebar-backdrop {
        display: block;
    }
}

/* Permission selector styling */
.permission-selector .card-header {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-primary);
    font-weight: 600;
}

.permission-selector .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.1);
    margin-bottom: 1rem;
}

.permission-selector .form-check-label {
    font-size: 0.875rem;
}

.permission-selector .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Notification center styling */
.notification-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.notification-unread {
    background-color: rgba(var(--bs-primary-rgb), 0.05) !important;
    border-left: 3px solid var(--bs-primary) !important;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
    opacity: 0.5;
}

/* Dropdown notification styling */
.dropdown-notifications {
    min-width: 380px;
    padding: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    border-radius: 10px;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1050;
}

.dropdown-notifications .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background-color: var(--bs-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.dropdown-notifications .dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--bs-body-color);
}

.dropdown-notifications .notification-item {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.2s ease;
}

.dropdown-notifications .notification-item:hover {
    background-color: rgba(var(--bs-light-rgb), 0.6);
    cursor: pointer;
}

.dropdown-notifications .notification-item:last-of-type {
    border-bottom: none;
}

.dropdown-notifications .notification-item.unread {
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

.dropdown-notifications .notification-item.unread::before {
    content: '';
    display: block;
    width: 4px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background-color: var(--bs-primary);
}

.dropdown-notifications .notification-title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    line-height: 1.4;
}

.dropdown-notifications .notification-message {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--bs-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Styling for HTML content in notifications */
.notification-content p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.notification-content ul, .notification-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    line-height: 1.5;
}

.notification-content li {
    margin-bottom: 0.5rem;
}

.notification-message p {
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.notification-message ul, .notification-message ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.notification-message li {
    margin-bottom: 0.5rem;
}

/* Dashboard notification styling */
.list-group-item div div p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.list-group-item div div ul, .list-group-item div div ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.list-group-item div div li {
    margin-bottom: 0.25rem;
}

/* Notification dropdown styling */
.dropdown-notifications .notification-message {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
}

.dropdown-notifications .notification-time {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    white-space: nowrap;
    opacity: 0.8;
}

.dropdown-notifications .notification-footer {
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background-color: var(--bs-light);
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

.dropdown-notifications .notification-footer a {
    color: var(--bs-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-notifications .notification-footer a:hover {
    color: var(--bs-primary-dark, var(--bs-primary));
    text-decoration: underline;
}

.dropdown-notifications .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty state styling */
.dropdown-notifications .empty-state-icon {
    margin: 2rem auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(var(--bs-light-rgb), 0.7);
}

/* Text truncate for 2 lines */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
}

/* Mark all read button styling */
.mark-all-read {
    font-size: 0.75rem;
    color: var(--bs-primary);
    text-decoration: none;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary-dark, var(--bs-primary));
}

/* Toast container for notification feedback */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
}