/* HRIS Application Styles */

:root {
    --sidebar-width: 280px;
    --navbar-height: 56px;
    
    /* ADP-Inspired Color Palette */
    --primary-color: rgb(1, 0, 53);          /* Deep navy blue */
    --secondary-color: rgb(208, 39, 29);     /* Deep red */
    --accent-color: rgb(56, 61, 90);         /* Medium blue-gray */
    --text-primary: rgb(33, 37, 54);         /* Dark blue-gray text */
    --text-secondary: rgb(138, 139, 143);    /* Medium gray text */
    --background-light: rgb(242, 243, 243);  /* Very light gray */
    --background-white: rgb(255, 255, 255);  /* Pure white */
    
    /* Status Colors */
    --success-color: #28a745;
    --danger-color: rgb(208, 39, 29);        /* Using ADP red */
    --warning-color: #ffc107;
    --info-color: rgb(56, 61, 90);           /* Using ADP medium blue */
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, rgb(1, 0, 53) 0%, rgb(33, 37, 54) 100%);
    --gradient-accent: linear-gradient(135deg, rgb(208, 39, 29) 0%, rgb(174, 32, 25) 100%);
    --gradient-light: linear-gradient(135deg, rgb(242, 243, 243) 0%, rgb(255, 255, 255) 100%);
}

/* Base Layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.main-content {
    margin-left: 250px;
    margin-top: 60px;
    padding: 30px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-content {
    height: 100%;
}

.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -40px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Login Page */
.login-page {
    background: var(--gradient-primary);
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-container .card {
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* Cards */
.card {
    border: none;
    background-color: var(--background-white);
    box-shadow: 0 2px 8px rgba(1, 0, 53, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(1, 0, 53, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--background-white);
    border-bottom: 1px solid var(--background-light);
    border-radius: 12px 12px 0 0 !important;
    color: var(--text-primary);
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 0, 53, 0.2);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--gradient-accent);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Tables */
.table {
    background-color: var(--background-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(1, 0, 53, 0.06);
}

.table thead th {
    background-color: var(--background-light);
    border-bottom: 2px solid var(--background-light);
    color: var(--text-primary);
    font-weight: 600;
    padding: 16px 12px;
}

.table tbody td {
    color: var(--text-primary);
    padding: 12px;
    vertical-align: middle;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alerts-container {
    position: fixed;
    top: calc(var(--navbar-height) + 20px);
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(1, 0, 53, 0.15);
}

/* Modern Card Enhancements */
.card-modern {
    border: none;
    border-radius: 16px;
    background: var(--background-white);
    box-shadow: 0 2px 16px rgba(1, 0, 53, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(1, 0, 53, 0.16);
}

.card-modern .card-header {
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-white) 100%);
    border: none;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
}

.card-modern .card-body {
    padding: 24px;
}

/* Modern Statistics Cards */
.stats-card-modern {
    background: var(--background-white);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: none;
    box-shadow: 0 2px 16px rgba(1, 0, 53, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
}

.stats-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(1, 0, 53, 0.16);
}

.dashboard-card .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.dashboard-card .card-text {
    font-size: 2rem;
    font-weight: bold;
}

.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card .stats-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stats-card .stats-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Attendance Calendar */
.calendar-day {
    min-height: 100px;
    border: 1px solid #dee2e6;
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.present {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.calendar-day.absent {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.calendar-day.late {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.calendar-day.holiday {
    background-color: #e2e3e5;
    border-color: #d6d8db;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sunpride Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 40px;
}

.stat-details h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.stat-label {
    font-size: 12px;
    color: #95a5a6;
}

/* Sunpride Buttons */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
}

.btn-info {
    background: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #e0a800;
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
}

/* Sunpride Data Tables */
.data-table, .departments-table, .employees-table, .overtime-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table thead, .departments-table thead, .employees-table thead, .overtime-table thead {
    background: #f8f9fa;
}

.data-table th, .departments-table th, .employees-table th, .overtime-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td, .departments-table td, .employees-table td, .overtime-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #dee2e6;
}

.data-table tbody tr:hover, .departments-table tbody tr:hover, .employees-table tbody tr:hover, .overtime-table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.show + .sidebar-overlay {
        display: block;
    }
    
    .alerts-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
    }
    
    .dashboard-card .card-text {
        font-size: 1.5rem;
    }
    
    .stats-card .stats-number {
        font-size: 1.5rem;
    }
}

/* Print Styles */
/* Custom Brand Colors */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #E67E22;
    border-color: #E67E22;
}

.navbar-dark {
    background: var(--gradient-primary) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Brand Gradients */
.bg-brand-gradient {
    background: var(--gradient-primary);
}

.bg-accent-gradient {
    background: var(--gradient-accent);
}

/* Loading Spinner Brand Colors */
.spinner {
    border-top: 4px solid var(--primary-color);
}

@media print {
    .navbar,
    .sidebar,
    .btn,
    .pagination,
    .alerts-container {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #fff;
    }
    
    .card {
        background-color: #343a40;
        color: #fff;
    }
    
    .table {
        background-color: #343a40;
        color: #fff;
    }
    
    .form-control, .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #fff;
    }
}