/* =================================================================
   LEAVE MANAGEMENT SYSTEM - CUSTOM STYLES
   Created: December 2024
   Purpose: Modern UI enhancements for leave management system
   ================================================================= */

/* ========================
   1. CUSTOM CSS VARIABLES
   ======================== */
:root {
    /* Leave System Brand Colors */
    --leave-primary: #667eea;
    --leave-secondary: #764ba2;
    --leave-primary-dark: #5568d3;
    --leave-secondary-dark: #5f3a82;
    
    /* Status Colors */
    --status-approved: #10b981;
    --status-approved-light: #d1fae5;
    --status-pending: #f59e0b;
    --status-pending-light: #fef3c7;
    --status-denied: #ef4444;
    --status-denied-light: #fee2e2;
    --status-cancelled: #dc3545;
    --status-cancelled-light: #ffe4e6;
    
    /* UI Colors */
    --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 15px;
    --transition-speed: 0.3s;
}

/* ========================
   2. STATUS BADGES
   ======================== */
.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-speed);
}

.status-badge i {
    font-size: 1rem;
}

/* Approved Status */
.status-approved,
.badge-approved {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.status-approved:hover {
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* Pending Status */
.status-pending,
.badge-pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.status-pending:hover {
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

/* Denied Status */
.status-denied,
.badge-denied {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.status-denied:hover {
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

/* Cancelled Status */
.status-cancelled,
.badge-cancelled {
    background: linear-gradient(135deg, #dc3545 0%, #b91c2b 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* ========================
   3. MODERN CARDS
   ======================== */
.card-modern {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.card-hover {
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* Card with Gradient Header */
.card-gradient-header .card-header {
    background: linear-gradient(135deg, var(--leave-primary) 0%, var(--leave-secondary) 100%);
    color: white;
    border: none;
    padding: 1.25rem;
}

/* ========================
   4. GRADIENT BACKGROUNDS
   ======================== */
.gradient-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.gradient-green {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
}

.gradient-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
}

.gradient-orange {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.gradient-red {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

/* Gradient Header */
.gradient-header {
    background: linear-gradient(135deg, var(--leave-primary) 0%, var(--leave-secondary) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* ========================
   5. STATISTICS CARDS
   ======================== */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed);
    border: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.stat-icon.icon-green {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.stat-icon.icon-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.stat-icon.icon-orange {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.stat-icon.icon-purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================
   6. MODERN TABLES
   ======================== */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
}

.table-modern thead th {
    background: linear-gradient(135deg, var(--leave-primary) 0%, var(--leave-secondary) 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table-modern thead th:first-child {
    border-radius: 10px 0 0 10px;
}

.table-modern thead th:last-child {
    border-radius: 0 10px 10px 0;
}

.table-modern tbody tr {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed);
}

.table-modern tbody td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.table-modern tbody tr:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: scale(1.01);
}

.table-modern tbody td:first-child {
    border-radius: 10px 0 0 10px;
}

.table-modern tbody td:last-child {
    border-radius: 0 10px 10px 0;
}

/* ========================
   7. ANIMATIONS
   ======================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ========================
   8. LOADING SPINNER
   ======================== */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--leave-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loader-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.loader-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ========================
   9. TOAST NOTIFICATIONS
   ======================== */
.toast-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.toast-close:hover {
    opacity: 1;
}

/* ========================
   10. BUTTONS
   ======================== */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--leave-primary) 0%, var(--leave-secondary) 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-gradient-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-gradient-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-gradient-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-gradient-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
    color: white;
}

/* ========================
   11. FORM ENHANCEMENTS
   ======================== */
.form-control-modern {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed);
}

.form-control-modern:focus {
    border-color: var(--leave-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label-modern {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* ========================
   12. TIMELINE
   ======================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--leave-primary);
}

.timeline-dot.success {
    border-color: var(--status-approved);
}

.timeline-dot.pending {
    border-color: var(--status-pending);
}

.timeline-dot.denied {
    border-color: var(--status-denied);
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

/* ========================
   13. BADGES & PILLS
   ======================== */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.pill-success {
    background: var(--status-approved-light);
    color: var(--status-approved);
}

.pill-pending {
    background: var(--status-pending-light);
    color: var(--status-pending);
}

.pill-denied {
    background: var(--status-denied-light);
    color: var(--status-denied);
}

/* ========================
   14. ALERT BOXES
   ======================== */
.alert-modern {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: var(--card-shadow);
}

.alert-modern-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.alert-modern-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.alert-modern-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.alert-modern-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

/* ========================
   15. PRINT STYLES
   ======================== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .gradient-header,
    .gradient-purple,
    .gradient-green,
    .gradient-blue {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .card-modern,
    .stat-card {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
    
    .table-modern tbody tr {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    .status-badge {
        border: 2px solid currentColor !important;
    }
}

/* ========================
   16. RESPONSIVE UTILITIES
   ======================== */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .table-modern {
        font-size: 0.875rem;
    }
    
    .toast-custom {
        min-width: 250px;
        right: 10px;
        top: 10px;
    }
    
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-dot {
        left: -22px;
        width: 16px;
        height: 16px;
    }
}

/* ========================
   17. DARK MODE (Optional)
   ======================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --text-primary: #ffffff;
        --card-bg: #2d2d2d;
        --card-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    }
    
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .card-modern,
    .stat-card {
        background-color: var(--card-bg);
        color: var(--text-primary);
    }
    
    .table-modern tbody tr {
        background-color: var(--card-bg);
    }
    
    .form-control-modern {
        background-color: var(--card-bg);
        color: var(--text-primary);
        border-color: #4b5563;
    }
}

/* ========================
   18. UTILITY CLASSES
   ======================== */
.text-gradient {
    background: linear-gradient(135deg, var(--leave-primary) 0%, var(--leave-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-custom {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-md-custom {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shadow-lg-custom {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--leave-primary), var(--leave-secondary)) border-box;
    border-radius: 10px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--leave-primary), var(--leave-secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--leave-primary-dark);
}

/* ========================
   END OF CUSTOM STYLES
   ======================== */
