/* ============================================
   MONOCHROME THEME - Student Management System
   Premium Black & White Layout
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --bg-sidebar: #050505;

    --accent-primary: #ffffff;
    --accent-hover: #e0e0e0;
    --accent-glow: rgba(255, 255, 255, 0.15);

    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #cccccc;

    --border-color: #222222;
    --border-accent: #ffffff;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.05);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================
   Layout Wrapper
   ============================================ */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-header img {
    max-height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
}

.role-badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: #a0a0a0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 0.1em;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 1.5rem 0;
    flex: 1;
}

.sidebar-nav .nav-section {
    padding: 1.5rem 1.75rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
    /* Changed to right for cleaner look */
    white-space: nowrap;
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.sidebar-nav a.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-right-color: var(--accent-primary);
}

.sidebar-nav a i {
    margin-right: 1rem;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.sidebar-nav a:hover i,
.sidebar-nav a.active i {
    color: var(--accent-primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.logout-btn i {
    margin-right: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */
#content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    background-color: var(--bg-primary);
}

#content.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-header #sidebarToggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.top-header #sidebarToggle:hover {
    background: var(--bg-card);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
}

.user-info i {
    font-size: 1.1rem;
}

/* Main Content Area */
.main-content {
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    max-width: 1600px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

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

.page-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header h2 i {
    color: var(--text-muted);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.card-header i {
    color: var(--text-muted);
}

.card-body {
    padding: 1.5rem;
    color: var(--text-secondary);
}

/* ============================================
   Stat Cards
   ============================================ */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: left;
    /* Modern Left Align */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-muted);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--text-primary);
    opacity: 0.1;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin: 1rem 0 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

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

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-align: center;
}

.quick-action:hover {
    background: var(--text-primary);
    color: #000;
    border-color: var(--text-primary);
}

.quick-action i {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.quick-action span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ============================================
   Tables
   ============================================ */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-secondary);
    --bs-table-border-color: var(--border-color);
}

.table-dark thead {
    background: var(--bg-secondary);
}

.table-dark thead th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table-dark tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background: var(--bg-input) !important;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    border-radius: 6px;
    margin: 0.2rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    border-radius: 6px !important;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.6rem 1.2rem;
}

.btn-primary:hover {
    background: #e0e0e0 !important;
    color: #000000 !important;
    border-color: #e0e0e0 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-outline-light {
    border-color: #ffffff !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    background: transparent;
}

.btn-outline-light:hover {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #000000 !important;
}

.btn-danger {
    background: #333333 !important;
    color: #ffffff !important;
    border: 1px solid #333333 !important;
}

.btn-danger:hover {
    background: #555555 !important;
    border-color: #555555 !important;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--text-primary) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
    background-color: var(--bg-card) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

/* ============================================
   Badges & Alerts
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.5em 0.9em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.alert {
    border-radius: var(--radius-md);
    border: 1px solid;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(5px);
}

.alert-success {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.alert-danger {
    background: rgba(255, 50, 50, 0.1);
    border-color: rgba(255, 50, 50, 0.2);
    color: #ff6b6b;
}

/* ============================================
   Login & Public Pages
   ============================================ */
body.public-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

.login-card {
    border: 1px solid var(--border-color);
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    height: 60px;
    width: auto;
}

.login-title {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ============================================
   Sidebar Overlay
   ============================================ */
.sidebar-overlay {
    display: none;
    cursor: pointer;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

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

    /* Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(2px);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    #content,
    #content.expanded {
        margin-left: 0;
        width: 100%;
    }

    .top-header {
        padding: 0 1rem;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .page-header h2 {
        font-size: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }


}

/* ============================================
   FullCalendar Overrides
   ============================================ */
.fc {
    color: #ffffff !important;
}

.fc-toolbar-title,
.fc-col-header-cell-cushion,
.fc-daygrid-day-number,
.fc-event-title,
.fc-event-time {
    color: #ffffff !important;
    text-decoration: none !important;
}

.fc-button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    text-transform: capitalize;
    font-weight: 600 !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 6px !important;
    opacity: 1 !important;
}

.fc-button:hover {
    background-color: #e0e0e0 !important;
    color: #000000 !important;
}

.fc-button-active {
    background-color: #cccccc !important;
    color: #000000 !important;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--border-color) !important;
}

/* ============================================
   Global Spacing & Text Fixes
   ============================================ */
.card-body,
.modal-body {
    color: #e0e0e0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: #ffffff !important;
}

.text-muted {
    color: #a0a0a0 !important;
}

/* ============================================
   Aggressive Global Resets & Contrast Fixes
   ============================================ */
input,
select,
textarea {
    background-color: var(--bg-input) !important;
    color: #ffffff !important;
    border: 1px solid var(--border-color) !important;
}

input:focus,
select:focus,
textarea:focus {
    background-color: var(--bg-card) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* Ensure table text is always visible */
td,
th,
tr {
    color: #ffffff !important;
}

/* Fix any potential random white backgrounds */
.bg-white {
    background-color: var(--bg-card) !important;
}

.text-dark {
    color: #ffffff !important;
}

/* Modal Fixes */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

.close,
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}