/* =====================================================
   AMS Design System - Professional & Stylish
   ===================================================== */

:root {
    --primary-color: #004aad;
    --primary-light: #e6f0ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --sidebar-width: 280px;
    --header-height: 70px;
    --font-heading: 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Segoe UI', system-ui, sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: #f4f6f9;
    /* College Background with lighter overlay for better visibility */
    background-image: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('../images/BackGround.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #333;
}

/* Card Hover Effect */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 74, 173, 0.15) !important;
}

/* -----------------------------------------------------
   NAVIGATION & SIDEBAR (Mini Sidebar)
   ----------------------------------------------------- */

/* Sidebar Container - FIXED Position, Left Docked */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    width: 70px;
    background: #ffffff;
    border-right: 1px solid #f0f0f0;
    z-index: 1030;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 10px;
    box-shadow: none;
    /* Default no shadow */

    /* Hide Scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* HOVER STATE - EXPAND (Slide Out) */
.sidebar:hover {
    width: 260px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    /* Add shadow on hover */
}

.sidebar-nav-container {
    padding: 0;
    width: 100%;
}

/* Nav Link Base */
.nav-link {
    color: #484644;
    border-radius: 0 25px 25px 0;
    /* Rounded right edge */
    margin: 0 8px 1px 0;
    /* TIGHT: Very small bottom margin */
    padding: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    height: 40px;
    /* TIGHT: Reduced height further */
    transition: all 0.2s ease;
    position: relative;
    border: none;
    overflow: hidden;
    white-space: nowrap;
}

/* Icon - Always visible, Fixed Width */
.nav-link i {
    font-size: 1.2rem;
    min-width: 70px;
    /* Center in collapsed 70px sidebar */
    text-align: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* COLORFUL ICONS via nth-child for variety */
/* Blue */
.nav-link:nth-child(1) i {
    color: #4e73df;
}

/* Green */
.nav-link:nth-child(2) i {
    color: #1cc88a;
}

/* Cyan */
.nav-link:nth-child(3) i {
    color: #36b9cc;
}

/* Yellow */
.nav-link:nth-child(4) i {
    color: #f6c23e;
}

/* Red */
.nav-link:nth-child(5) i {
    color: #e0868e;
}

/* Grey */
.nav-link:nth-child(6) i {
    color: #858796;
}

/* Grey */
.nav-link:nth-child(n+7) i {
    color: #5a5c69;
}

/* Dark */

/* Override for Sign Out (Red) */
.nav-link.text-danger i {
    color: #dc3545 !important;
}

/* Override colors for active state if needed, or keep colorful? 
   Let's keep colorful but add background highlight */

/* Text - Hidden in collapsed, visible on hover */
.nav-link span {
    opacity: 0;
    transform: translateX(-15px);
    transition: all 0.3s ease;
    display: inline-block;
}

/* Hover State */
.nav-link:hover {
    background-color: #f8f9fc;
}

.nav-link:hover i {
    transform: scale(1.15);
}

/* Sidebar Hover -> Show Text */
.sidebar:hover .nav-link span {
    opacity: 1;
    transform: translateX(0);
}

/* Active State */
.nav-link.active {
    background: #d6dcf2;
    /* Light Grey/Blue bg */
    font-weight: 700;
    border-left: 2px solid #004aad;
}

/* Sidebar Section Headers */
.sidebar .text-uppercase {
    opacity: 0;
    height: 0;
    margin: 0 !important;
    overflow: hidden;
}

.sidebar:hover .text-uppercase {
    opacity: 1;
    height: auto;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
    padding-left: 1.5rem;
    /* Indent headers */
}

/* Content Wrapper - Static Margin */
/* The sidebar overlays on hover, so margin stays 70px */
.main-content-wrapper {
    margin-left: 70px;
    transition: margin-left 0.3s ease;
    padding-top: 80px;
    min-height: 100vh;
}


/* Content Wrapper to prevent sidebar overlap */
.main-content-wrapper {
    margin-left: 70px;
    /* Default collapsed width */
    transition: margin-left 0.3s ease;
    padding-top: 80px;
    /* Header height + spacing */
    min-height: 100vh;
}


.sidebar.expanded~main.main-content-wrapper,
/* If sibling selector doesn't work due to DOM structure (Nav -> Main), we rely on JS toggling a class on body or main. 
   Let's assume the JS 'toggleSidebar' needs to toggle a class on the wrapper too, or we use a general sibling selector if they are siblings. 
   In base.html: <nav id="sidebar"> then <main>. They ARE siblings. */
.sidebar.expanded+.main-content-wrapper {
    margin-left: 260px;
}

/* When sidebar is hidden (e.g. Public pages) */
.main-content-wrapper.no-sidebar {
    margin-left: 0 !important;
}



/* -----------------------------------------------------
   DASHBOARD TILES FIX
   ----------------------------------------------------- */

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #004aad, #007bff) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #0f9d58, #28a745) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #00bcd4, #17a2b8) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ff9800, #ffc107) !important;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #e91e63, #dc3545) !important;
}

/* Dashboard Tile Styling - FORCE TRANSPARENT BG to see gradient */
.dashboard-tile.vibrant-tile {
    background-color: transparent !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.dashboard-tile.vibrant-tile:hover {
    transform: translateY(-5px);
}

.dashboard-tile.vibrant-tile .rounded-circle {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
}

.dashboard-tile.vibrant-tile h3,
.dashboard-tile.vibrant-tile span {
    color: white !important;
}

/* -----------------------------------------------------
   HEADER & PAGE LAYOUT
   ----------------------------------------------------- */

#mainHeader {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Clean Page Title Header (Non-Tile) */
.page-header-block {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.page-header-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}

.page-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(275deg, var(--primary-color), #2e639c);
    color: #fff;
    border-radius: 25px;
    margin-right: 15px;
    font-size: 1.0rem;
    box-shadow: 0 4px 10px rgba(0, 74, 173, 0.2);
}

/* Breadcrumbs Styling */
.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
    /* font-size: 0.9rem; */
}

.breadcrumb-item a:hover {
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
    font-weight: 400;
}

.breadcrumb-item i {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Sub-headings */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

/* -----------------------------------------------------
   COMPONENTS
   ----------------------------------------------------- */

/* Buttons: Consistent Styling */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

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

.btn-primary:hover {
    background: #003680;
    /* Darker shade */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 74, 173, 0.25);
}

.btn-success {
    background: #10b981;
    /* Modern Green */
    border: none;
}

.btn-danger {
    background: #ef4444;
    /* Modern Red */
    border: none;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    background: #fff;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    /* Lift effect */
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Tables */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem;
}

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

.table-custom tbody tr:hover {
    background-color: #fafbfc;
}

/* Tabs (for Sub-tabs) */
.nav-tabs .nav-link {
    border: none;
    background: transparent;
    color: #666;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 74, 173, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
    font-weight: 600;
}

/* NProgress Customization */
#nprogress .bar {
    background: #ff006e !important;
    /* Stylish Pink contrast for loading */
    height: 3px !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px #ff006e, 0 0 5px #ff006e !important;
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}