/* Modern UI Enhancements - Consolidated - Academic Information System */

/* ============================================
   POPPINS FONT IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --primary-blue: #1C5894;
    --primary-blue-dark: #154673;
    --gradient-primary: linear-gradient(135deg, #1C5894 0%, #154673 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #0e8070 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #3d9ae5 100%);
    --gradient-warning: linear-gradient(135deg, #f5576c 0%, #e04556 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ============================================
   GLOBAL STYLES & TYPOGRAPHY
   ============================================ */
* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #f5f7fa;
    font-weight: 400;
    letter-spacing: 0.01em;
    font-size: 0.875rem;
    color: #2d3748;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1a202c;
}

/* ============================================
   LAYOUT & SIDEBAR (NEW)
   ============================================ */
.sidebar-fixed {
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    background: var(--primary-blue);
    color: white;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar for Sidebar */
.sidebar-fixed::-webkit-scrollbar {
    width: 6px;
}

.sidebar-fixed::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 6px;
}

.sidebar-fixed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.sidebar-fixed::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.main-content-wrapper {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    border: none;
    /* Reset */
    margin: 0;
    /* Reset */
}

.sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.85);
    /* Ensure icons take color */
}

.sidebar .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.sidebar .nav-link:hover i {
    color: white;
    transform: scale(1.1);
}

.sidebar .nav-link.active {
    color: var(--primary-blue);
    background: white;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link.active i {
    color: var(--primary-blue);
}

/* Sidebar Header & User Info */
.sidebar-header {
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    margin-top: auto;
    /* Push to bottom if using flex column */
}

/* Mobile Responsive Layout */
@media (max-width: 991.98px) {
    .sidebar-fixed {
        transform: translateX(-100%);
    }

    .sidebar-fixed.show {
        transform: translateX(0);
    }

    .main-content-wrapper {
        margin-left: 0;
        padding: 0.75rem;
    }

    .navbar-toggler-wrap {
        display: block !important;
    }

    /* Mobile Navigation Improvements */
    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .navbar .btn-link {
        padding: 0.5rem;
        font-size: 1.25rem;
    }

    /* Mobile Action Buttons - Stack Vertically */
    .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Quick Filter Pills - Horizontal Scroll */
    .btn-group[role="group"] {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.5rem;
    }

    .btn-group[role="group"]::-webkit-scrollbar {
        display: none;
    }

    .btn-group[role="group"] .btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Card improvements for mobile */
    .card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Form inputs - larger touch targets */
    .form-control,
    .form-select {
        padding: 0.625rem 0.875rem;
        font-size: 1rem;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Data Grid - Card Layout for Mobile */
    .table-responsive {
        overflow-x: visible;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table tbody tr {
        display: block;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .mobile-card-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f1f3f5;
    }

    .mobile-card-table tbody td:last-child {
        border-bottom: none;
        justify-content: center;
        padding-top: 1rem;
    }

    .mobile-card-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #6c757d;
        margin-right: 1rem;
    }

    .mobile-card-table tbody td:first-child::before,
    .mobile-card-table tbody td:last-child::before {
        content: none;
    }

    .mobile-card-table tbody td:first-child {
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Avatar adjustments for mobile cards */
    .mobile-card-table .avatar-circle {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }

    /* Hide location column on very small screens */
    .mobile-card-table td[data-label="Location"] {
        display: none;
    }

    /* Pagination improvements */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
    }

    /* Search bar full width */
    .flex-grow-1.ms-md-4 {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-top: 1rem;
    }

    /* Alert improvements */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   MODERN CARD DESIGN
   ============================================ */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

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

.card-header {
    background: var(--gradient-primary);
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    border-radius: 16px 16px 0 0 !important;
}

.card-header.white-header {
    background: #ffffff !important;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   MODERN BUTTONS
   ============================================ */
.btn {
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

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

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

.btn-success {
    background: #11998e;
    color: white;
}

.btn-success:hover {
    background: #0e8070;
    color: white;
}

.btn-info {
    background: #4facfe;
    color: white;
}

.btn-info:hover {
    background: #3d9ae5;
    color: white;
}

.btn-warning {
    background: #f5576c;
    color: white;
}

.btn-warning:hover {
    background: #e04556;
    color: white;
}

.btn-danger {
    background: #ff0844;
    color: white;
}

.btn-danger:hover {
    background: #e6073d;
    color: white;
}

/* ============================================
   MODERN TABLES
   ============================================ */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.modern-table thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border: none;
}

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

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

.modern-table tbody tr {
    transition: all 0.2s ease;
    background: white;
}

.modern-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
}

.modern-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

/* ============================================
   DASHBOARD SPECIFIC (Merged from modern-dashboard.css)
   ============================================ */
.dashboard-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
    transform: skewX(-20deg);
}

.stat-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    background: white;
    position: relative;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    font-size: 1.25rem;
}

.stat-card.card-primary {
    background: var(--gradient-primary);
    color: white;
}

.stat-card.card-success {
    background: var(--gradient-success);
    color: white;
}

.stat-card.card-info {
    background: var(--gradient-info);
    color: white;
}

.stat-card.card-warning {
    background: var(--gradient-warning);
    color: white;
}

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.rounded {
    border-radius: 12px !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.alert,
.sidebar-fixed {
    animation: fadeIn 0.4s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

/* ============================================
   REFINED SIDEBAR BRANDING
   ============================================ */
.sidebar-header {
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
}

.sidebar-brand:hover {
    color: white;
    opacity: 0.9;
}

.sidebar-brand i {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   QUICK ACTION GRID
   ============================================ */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    height: 100%;
    border: none;
    width: 100%;
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    color: white;
}

.quick-action-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.quick-action-card span {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Specific Quick Action Colors */
.qa-primary {
    background: linear-gradient(135deg, #1C5894 0%, #154673 100%);
}

.qa-info {
    background: linear-gradient(135deg, #4facfe 0%, #3d9ae5 100%);
}

.qa-success {
    background: linear-gradient(135deg, #11998e 0%, #0e8070 100%);
}

/* Full Width Button Variant */
.quick-action-full {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #11998e 0%, #0e8070 100%);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    border: none;
    margin-top: 1rem;
}

.quick-action-full:hover {
    transform: translateY(-2px);
    color: white;
}

/* ============================================
   HEADER TEXT COLOR OVERRIDES
   ============================================ */
/* Force headings in card headers and dashboard headers to be white 
   to override the global dark heading color */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.dashboard-header h1,
.dashboard-header h2,
.dashboard-header h3,
.dashboard-header h4,
.dashboard-header h5,
.dashboard-header h6 {
    color: white !important;
}

/* Exception for explicitly white-background headers */
.card-header.white-header h1,
.card-header.white-header h2,
.card-header.white-header h3,
.card-header.white-header h4,
.card-header.white-header h5,
.card-header.white-header h6 {
    color: #2d3748 !important;
}

/* ============================================
   MOBILE NAVIGATION TOGGLE (NEW)
   ============================================ */
.mobile-nav-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1040;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: white;
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-toggle:active {
    transform: scale(0.95);
    background: #f8f9fa;
}

/* Enhancements for Content Layout without Top Nav */
@media (max-width: 991.98px) {

    /* Reserve space for the floating toggle area */
    .main-content-wrapper {
        padding-top: 4.5rem;
    }

    /* Reduce Dashboard Header Size on Mobile */
    .dashboard-header {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    /* Compact Stats Cards on Mobile */
    .stat-card .card-body {
        padding: 1rem;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ============================================
   STAFF PAGE ENHANCEMENTS
   ============================================ */
.staff-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    background: white;
    overflow: hidden;
}

.staff-header {
    padding: 2rem;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.staff-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.staff-role-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.35rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.staff-body {
    padding: 2rem;
}

.staff-detail-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.staff-detail-item:hover {
    background-color: #f8fafc;
}

.staff-label {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.staff-label i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
}

.staff-value {
    font-size: 1rem;
    color: #334155;
    font-weight: 600;
    padding-left: 1.75rem;
    /* Icon width + gap */
}

.staff-actions {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-suspend {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 0.5rem;
}