/* ============================================
   UNIFIED DASHBOARD STYLES
   Professional CSS for Staff Portal System
   ============================================ */

/* ============================================
   1. GLOBAL & LAYOUT STYLES
   ============================================ */

body {
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wrapper {
    display: flex;
    min-height: 100vh;
}

/* Main Content Area */
.main-content,
#content {
    width: 100%;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    padding: 20px;
}

@media (max-width: 768px) {
    .main-content,
    #content {
        margin-left: 0;
    }
}

/* ============================================
   2. DARK MODE SUPPORT
   ============================================ */

.dark-mode {
    background-color: #121212;
    color: #f1f1f1;
}

.dark-mode a,
.dark-mode .nav-link {
    color: #f1f1f1;
}

.dark-mode #sidebar,
.dark-mode .sidebar {
    background-color: #1e1e1e;
    border-color: #333;
}

.dark-mode #sidebar .nav-link.active,
.dark-mode .sidebar .nav-link.active {
    background-color: #333;
}

.dark-mode .card {
    background-color: #1e1e1e;
    border-color: #333;
}

.dark-mode .stats-card,
.dark-mode .quick-action-card,
.dark-mode .stat-card,
.dark-mode .action-card,
.dark-mode .document-card {
    background-color: #1e1e1e;
    border-color: #333;
}

/* ============================================
   3. SIDEBAR STYLES
   ============================================ */

#sidebar,
.sidebar {
    width: 280px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

#sidebar .nav-link.active,
.sidebar .nav-link.active {
    background-color: #e9ecef;
    font-weight: bold;
}

/* Sidebar mobile behavior */
@media (max-width: 992px) {
    #sidebar,
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    #sidebar.show,
    .sidebar.show,
    #sidebar.active,
    .sidebar.active {
        transform: translateX(0);
    }

    #menuToggle {
        display: block !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1050;
        border-radius: 8px;
        background: white;
    }

    #menuToggle i {
        font-size: 1.3rem;
    }

    #content {
        margin-left: 0 !important;
    }
}

/* ============================================
   4. STICKY PROFILE CARD
   ============================================ */

.sticky-profile {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

@media (max-width: 991px) {
    .sticky-profile {
        position: relative;
        top: 0;
        max-height: none;
    }
}

/* ============================================
   5. GRADIENT BACKGROUNDS
   ============================================ */

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

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

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #0dcaf0 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #f85866 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8800 100%);
}

/* ============================================
   6. CARD STYLES & HOVER EFFECTS
   ============================================ */

.stats-card,
.stat-card,
.quick-action-card,
.action-card,
.document-card {
    transition: all 0.3s ease;
    border: 1px solid transparent !important;
}

.stats-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.quick-action-card:hover,
.action-card:hover,
.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background-color: #ffffff !important;
}

.quick-action-card:hover .fa-chevron-right,
.action-card:hover .fa-chevron-right,
.document-card:hover .fa-chevron-right {
    transform: translateX(5px);
    transition: transform 0.3s ease;
}

.card {
    border-radius: 12px;
    overflow: hidden;
}

/* ============================================
   7. NAVIGATION MENU STYLES
   ============================================ */

.nav-menu-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-menu-item:hover {
    background-color: #f8f9fa;
    border-left-color: #667eea;
    transform: translateX(3px);
}

.nav-menu-item.active {
    background-color: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    font-weight: 600;
}

.nav-menu-item i {
    width: 20px;
    text-align: center;
}

/* ============================================
   8. BADGE & OPACITY UTILITIES
   ============================================ */

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

.bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.bg-info-subtle {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* ============================================
   9. SCROLLBAR STYLING
   ============================================ */

.sticky-profile::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
#sidebar::-webkit-scrollbar {
    width: 6px;
}

.sticky-profile::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
#sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.sticky-profile::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.sticky-profile::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
#sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   10. CALENDAR STYLES
   ============================================ */

.calendar-grid {
    width: 100%;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 5px;
}

.day-header {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #6c757d;
    padding: 8px 4px;
}

.calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-date:hover {
    background-color: #e9ecef;
}

.calendar-date.today {
    background-color: #0d6efd;
    color: white;
    font-weight: bold;
}

.calendar-date.other-month {
    color: #adb5bd;
}

.calendar-date.selected {
    background-color: #198754;
    color: white;
}

#mini-calendar {
    max-width: 100%;
}

.calendar-header button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   11. BUTTON ENHANCEMENTS
   ============================================ */

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* ============================================
   12. ANIMATION UTILITIES
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

/* ============================================
   13. RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 1200px) {
    .main-content, #content { padding: 15px; }
}

@media (max-width: 992px) {
    .stats-card, .quick-action-card { margin-bottom: 15px; }
}

@media (max-width: 576px) {
    .main-content, #content { padding: 10px; }
    .card { margin-bottom: 15px; }
}

/* ============================================
   14. ACCESSIBILITY IMPROVEMENTS
   ============================================ */

.btn:focus,
.nav-link:focus,
.form-control:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   15. PRINT STYLES
   ============================================ */

@media print {
    #sidebar, .sidebar, .sticky-profile { display: none; }
    .main-content, #content { margin-left: 0; width: 100%; }
    .stats-card, .quick-action-card, .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
    }
}

/* ============================================
   16. LOADING & SKELETON STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   17. UTILITY CLASSES
   ============================================ */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.3s ease; }
