/* Leave Management System Styles */

/* Enhanced Date Picker Styling */
input[type="date"].form-control,
input[type="date"].form-control-lg {
    position: relative;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    cursor: pointer;
}

input[type="date"].form-control-lg {
    min-height: 48px;
    font-size: 1.1rem;
    padding: 12px 45px 12px 16px;
    background-position: right 16px center;
    background-size: 20px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

input[type="date"]:hover {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    transition: all 0.2s ease;
}

input[type="date"]:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* Select Dropdown Consistency */
.form-select-lg {
    min-height: 48px;
    font-size: 1.1rem;
    padding: 12px 45px 12px 16px;
}

/* Leave Balance Cards */
.leave-balance-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.leave-balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.leave-available-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
}

.leave-progress-bar {
    border-radius: 4px;
    overflow: hidden;
}

.leave-progress-bar .progress-bar {
    transition: width 0.6s ease;
}

/* Leave Request Cards */
.leave-request-card {
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.leave-request-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.leave-request-card[data-status="Approved"] {
    border-left-color: #28a745;
}

.leave-request-card[data-status="Pending"] {
    border-left-color: #ffc107;
}

.leave-request-card[data-status="Rejected"] {
    border-left-color: #dc3545;
}

.leave-request-card[data-status="Cancelled"] {
    border-left-color: #6c757d;
}

/* Leave Status Badge */
.leave-status-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

/* Tables */
.leave-request-table {
    font-size: 0.9rem;
}

.leave-request-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.leave-request-table tbody tr {
    transition: background-color 0.2s;
}

.leave-request-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Empty States */
.leave-empty-state {
    padding: 3rem 1rem;
}

.leave-empty-state i {
    opacity: 0.5;
}

/* Calendar Styles */
.leave-calendar-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leave-calendar-event {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    border-left: 3px solid;
    background: #f8f9fa;
    transition: all 0.2s;
}

.leave-calendar-event:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leave-calendar-event.approved {
    border-left-color: #28a745;
    background: #d4edda;
}

.leave-calendar-event.pending {
    border-left-color: #ffc107;
    background: #fff3cd;
}

/* Form Styles */
.leave-form-section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.leave-form-section h5 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

/* Date Range Picker */
.leave-date-picker {
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.leave-date-picker:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Statistics Cards */
.leave-stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.2s;
}

.leave-stat-card:hover {
    transform: translateY(-4px);
}

.leave-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 1rem 0;
}

.leave-stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Approval Actions */
.leave-approval-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.leave-approval-btn {
    flex: 1;
    min-width: 120px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .leave-balance-card {
        margin-bottom: 1rem;
    }
    
    .leave-request-table {
        font-size: 0.8rem;
    }
    
    .leave-request-table th,
    .leave-request-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .leave-approval-actions {
        flex-direction: column;
    }
    
    .leave-approval-btn {
        width: 100%;
    }
    
    .leave-stat-value {
        font-size: 2rem;
    }
    
    .leave-form-section {
        padding: 1rem;
    }
    
    /* Responsive button groups in filter sections */
    .row .d-flex.gap-2 .btn,
    .row .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    /* Ensure consistent spacing for button groups */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        gap: 0.75rem !important;
    }
}

@media (max-width: 576px) {
    /* On very small screens, reduce button padding */
    .btn {
        padding: 8px 16px !important;
        font-size: 14px;
    }
    
    .btn i {
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .leave-approval-actions,
    .btn,
    .leave-view-btn {
        display: none !important;
    }
    
    .leave-request-table {
        font-size: 0.75rem;
    }
}

/* Loading States */
.leave-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.leave-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltips */
.leave-tooltip {
    position: relative;
    cursor: help;
}

.leave-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: #333;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.85rem;
    z-index: 1000;
}

/* Notification Badges */
.leave-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================
   EMPLOYEE DASHBOARD STYLES
   ============================================ */

/* Dashboard Cards */
.dashboard-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* KPI Cards */
.kpi-card {
    color: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.kpi-card.pending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.kpi-card.upcoming {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.kpi-card.used {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.3);
}

.kpi-card.available {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    box-shadow: 0 4px 15px rgba(250, 112, 154, 0.3);
}

.kpi-card h2 {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.kpi-card .label {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, #003860 0%, #005a9e 100%);
    color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 56, 96, 0.3);
}

.welcome-card h4 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white !important;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 0;
    color: white !important;
}

.welcome-card .btn {
    background: white;
    color: #003860 !important;
    border: 2px solid white;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 8px;
    transition: all 0.3s;
}

.welcome-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
    color: #003860 !important;
}

.welcome-card .btn span {
    color: #003860 !important;
}

.welcome-card .btn:hover span {
    color: #003860 !important;
}

.welcome-card .btn i {
    color: #003860 !important;
}

.welcome-card .btn:hover i {
    color: #003860 !important;
}

/* Leave Statistics Cards */
.leave-stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.leave-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.leave-stat-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 3px solid #003860;
    padding: 15px 20px;
    font-weight: 600;
    color: #003860;
    font-size: 16px;
}

.stat-row {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.stat-row:hover {
    background-color: #f8f9fa;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.stat-value.highlight {
    color: #003860;
    font-size: 18px;
}

.request-btn {
    background: linear-gradient(135deg, #003860 0%, #005a9e 100%);
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 15px;
}

.request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 56, 96, 0.3);
    color: white;
}

/* Upcoming Leave Items */
.upcoming-leave-item {
    background: white;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.upcoming-leave-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.upcoming-leave-item.pending {
    border-left-color: #ffc107;
}

/* Quick Action Buttons */
.quick-action-btn {
    border-radius: 10px;
    padding: 15px 20px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Section Title */
.section-title {
    color: #003860;
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* ============================================
   CALENDAR VIEW STYLES
   ============================================ */

.leave-calendar-wrapper {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.leave-calendar-wrapper .table {
    border-collapse: separate;
    border-spacing: 2px;
}

.leave-calendar-wrapper .table thead th {
    background: linear-gradient(135deg, #003860 0%, #005a9e 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 600;
    padding: 15px 8px;
    text-align: center;
    border: none;
}

.leave-calendar-wrapper .table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.leave-calendar-wrapper .table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.leave-calendar-wrapper td {
    height: 120px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    vertical-align: top;
    position: relative;
    transition: all 0.2s;
}

.leave-calendar-wrapper td:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.leave-calendar-wrapper td.text-muted {
    background: #f8f9fa;
    opacity: 0.6;
}

.today-cell {
    outline: 3px solid #003860;
    outline-offset: -3px;
    background: #eef5ff !important;
    font-weight: 600;
}

.today-cell strong {
    background: #003860;
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    display: inline-block;
    min-width: 28px;
    text-align: center;
}

/* Calendar Event Styles */
.leave-calendar-event {
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.leave-calendar-event.approved {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left-color: #28a745;
    color: #155724;
}

.leave-calendar-event.approved:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
    transform: scale(1.02);
}

.leave-calendar-event.pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left-color: #ffc107;
    color: #856404;
}

.leave-calendar-event.pending:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    transform: scale(1.02);
}

.leave-calendar-event small {
    display: block;
    font-size: 9px;
    margin-top: 2px;
    opacity: 0.9;
}

/* Calendar Navigation */
.calendar-nav {
    background: linear-gradient(135deg, #003860 0%, #005a9e 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.calendar-nav .btn {
    border-radius: 6px;
    font-weight: 500;
}

.calendar-nav .btn-outline-secondary {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.calendar-nav .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.calendar-nav .btn-light {
    background: white;
    color: #003860;
    font-weight: 600;
    min-width: 180px;
}

/* Holiday Badge */
.holiday-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
}

/* Calendar Filter Card */
.calendar-filter-card {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: none;
}

.calendar-filter-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #003860;
    border-radius: 12px 12px 0 0;
    padding: 15px 20px;
}

.calendar-filter-card h5 {
    color: #003860;
    font-weight: 600;
    margin: 0;
}

/* Next Holiday Alert */
.next-holiday-alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.next-holiday-alert i {
    color: #1976d2;
    font-size: 20px;
}

/* Leave Empty State */
.leave-empty-state {
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.leave-empty-state i {
    color: #adb5bd;
}

/* ============================================
   MY LEAVE REQUESTS PAGE STYLES
   ============================================ */

/* Summary Cards with Gradients */
.summary-card-gradient {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.summary-card-gradient:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.summary-card-gradient.pending {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.summary-card-gradient.approved {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.summary-card-gradient.rejected {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.summary-card-gradient.total {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
}

/* ============================================
   CALENDAR SYNC TOGGLE WIDGET
   ============================================ */

.calendar-sync-toggle-widget {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.calendar-sync-toggle-widget:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.calendar-sync-toggle-widget .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.calendar-sync-toggle-widget .form-check-input:checked {
    background-color: #28a745;
    border-color: #28a745;
}

.calendar-sync-toggle-widget .form-check-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.calendar-sync-toggle-widget .form-check-label {
    cursor: pointer;
    user-select: none;
}

@media (max-width: 768px) {
    .calendar-sync-toggle-widget {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .calendar-sync-toggle-widget .form-check-input {
        width: 2.5rem;
        height: 1.25rem;
    }
}
