/* International University of Erbil Management System - Dark Theme */

:root {
    --primary-black: #000000;
    --primary-gold: #BFA046;
    --primary-gray: #666666;
    --light-gray: #333333;
    --dark-gray: #1a1a1a;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Font Families */
.font-serif {
    font-family: 'Playfair Display', Georgia, serif;
}

.font-sans {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--primary-black) 100%);
    color: var(--white);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Moving department names background */
.dept-marquee {
    /* Disabled: dynamic background removed */
    display: none !important;
    position: static !important;
    inset: auto !important;
    overflow: visible !important;
    z-index: auto !important;
    pointer-events: auto !important;
}
/* Disable moving background on mobile screens & for users preferring reduced motion */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .dept-marquee { display: none !important; }
}
/* Floating word bubbles */
.dept-bubble {
        position: absolute;
        display: inline-block;
        font-family: 'Playfair Display', serif;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--primary-gold);
        opacity: 0.04;
        filter: blur(0.2px);
        white-space: nowrap;
        will-change: transform, opacity;
        pointer-events: none;
}

/* small text by default */
.dept-bubble { font-size: clamp(10px, 1.6vw, 16px); letter-spacing: 1px; }

/* Keyframes for gentle floating */
@keyframes floatXY {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(10px, -15px) scale(1.02); }
    50%  { transform: translate(-8px, 12px) scale(0.98); }
    75%  { transform: translate(14px, 6px) scale(1.01); }
    100% { transform: translate(0, 0) scale(1); }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: var(--primary-gold);
}

/* Custom Bootstrap Theme */
.bg-dark {
    background: linear-gradient(90deg, var(--primary-black) 0%, var(--dark-gray) 100%) !important;
}

.text-gold {
    color: var(--primary-gold) !important;
}

.bg-gold {
    background-color: var(--primary-gold) !important;
}

.btn-gold {
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
    color: var(--primary-black);
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-gold:hover {
    background-color: #d4b654;
    border-color: #d4b654;
    color: var(--primary-black);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(191, 160, 70, 0.3);
}

.btn-outline-gold {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.btn-outline-gold:hover {
    background-color: var(--primary-gold);
    color: var(--primary-black);
}

/* Navigation */
.navbar.navbar-modern {
    background: linear-gradient(90deg, rgba(0,0,0,0.75), rgba(26,26,26,0.65)) !important;
    border-bottom: 1px solid rgba(191, 160, 70, 0.18);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
        min-height: 64px;
        height: 64px; /* lock height so dropdown doesn't stretch bar */
        display: flex;
        align-items: center;
        overflow: visible; /* allow dropdown to overflow */
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-gold) !important;
}

.brand-text {
    background: linear-gradient(45deg, var(--primary-gold), #d4b654);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    padding: 0.6rem 0.9rem !important;
}

.nav-link:hover {
    color: var(--primary-gold) !important;
}

/* Underline animation for nav links */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: width 0.2s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Active state */
.nav-link.active {
    color: var(--primary-gold) !important;
}
.nav-link.active::after {
    width: 100%;
}

/* Remove Bootstrap caret triangle but keep ::after for underline animation */
.dropdown-toggle::after {
    border: none !important;          /* hide triangle */
    margin: 0 !important;             /* remove caret spacing */
    vertical-align: baseline !important;
}

/* Dropdown polish */
.navbar .dropdown-menu {
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid rgba(191,160,70,0.25);
        position: absolute; /* ensure it sits over content, not pushing navbar */
        top: calc(100% + 6px);
        right: 0;
        left: auto;
        z-index: 1200;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.navbar .dropdown-item i {
    width: 18px;
}
.navbar .dropdown-item {
    padding: 0.55rem 0.85rem;
}
.navbar .dropdown-divider {
    border-top-color: rgba(191,160,70,0.25);
}

/* Role pill */
.role-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid rgba(191,160,70,0.5);
    border-radius: 999px;
    color: var(--primary-gold);
}

/* Toggler spacing */
.navbar .navbar-toggler {
    border-color: rgba(191,160,70,0.35);
}
.navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.15rem rgba(191,160,70,0.35);
}

/* User Avatar */
.user-avatar {
    font-size: 1.5rem;
    color: var(--primary-gold);
}

/* Main Content */
.main-content {
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
    z-index: 1; /* keep above moving background */
}

/* Desktop width constraints - Better responsive design (only for logged-in content) */
@media (min-width: 1200px) {
    .main-content:not(.main-content-auth) .container-fluid {
        max-width: 1140px;
        margin: 0 auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1400px) {
    .main-content:not(.main-content-auth) .container-fluid {
        max-width: 1320px;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (min-width: 1600px) {
    .main-content:not(.main-content-auth) .container-fluid {
        max-width: 1500px;
    }
}

.main-content-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cards */
.card {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(191, 160, 70, 0.2);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(191, 160, 70, 0.2);
    border-color: rgba(191, 160, 70, 0.4);
}

.card-header {
    background: linear-gradient(45deg, var(--primary-black), var(--dark-gray));
    border-bottom: 1px solid rgba(191, 160, 70, 0.2);
    color: var(--primary-gold);
    font-weight: 600;
}

/* Dashboard Cards */

/* Keep nav links on one line and prevent wrapping within navbar */
.navbar-nav.flex-row { flex-wrap: nowrap; }
.navbar-nav.flex-row .nav-link { white-space: nowrap; }
.stats-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), #d4b654);
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-gold);
    font-family: 'Inter', sans-serif;
}

.stats-label {
    color: var(--primary-gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Forms */
.form-control, .form-select {
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(191, 160, 70, 0.3);
    color: var(--white);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(26, 26, 26, 0.9);
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 0.25rem rgba(191, 160, 70, 0.25);
    color: var(--white);
}

.form-control::placeholder {
    color: var(--primary-gray);
}

.form-label {
    color: var(--white);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Desktop form improvements */
@media (min-width: 768px) {
    .form-control, .form-select {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .form-label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
}

/* Tables */
.table-dark {
    --bs-table-bg: rgba(26, 26, 26, 0.8);
    --bs-table-border-color: rgba(191, 160, 70, 0.2);
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: rgba(191, 160, 70, 0.1);
}

/* Modals */
.modal-content {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(191, 160, 70, 0.3);
}
.modal { z-index: 1300; }
.modal-backdrop { z-index: 1290; }

.modal-header {
    border-bottom: 1px solid rgba(191, 160, 70, 0.2);
}

.modal-footer {
    border-top: 1px solid rgba(191, 160, 70, 0.2);
}

/* Dropdowns */
.dropdown-menu {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(191, 160, 70, 0.3);
}

.dropdown-item {
    color: var(--white);
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgba(191, 160, 70, 0.2);
    color: var(--primary-gold);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    width: 100vw;
    background: #0a0f1a !important;
    background-image: none !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-x: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="%23BFA046" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.login-card {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(191, 160, 70, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-logo {
    max-width: 120px;
    filter: drop-shadow(0 4px 8px rgba(191, 160, 70, 0.3));
}

/* Desktop login improvements */
@media (min-width: 768px) {
    .login-container {
        padding: 3rem;
    }
    
    .login-card {
        max-width: 500px;
        padding: 3rem;
        border-radius: 25px;
    }
    
    .login-logo {
        max-width: 150px;
    }
}

@media (min-width: 1200px) {
    .login-container {
        padding: 4rem;
    }
    
    .login-card {
        max-width: 600px;
        padding: 4rem;
        border-radius: 30px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    }
    
    .login-logo {
        max-width: 180px;
    }
}

/* File Upload */
.dropzone {
    border: 2px dashed rgba(191, 160, 70, 0.4) !important;
    background: rgba(26, 26, 26, 0.5) !important;
    border-radius: var(--border-radius) !important;
    transition: border-color 0.2s ease, background 0.2s ease !important;
}

.dropzone:hover {
    border-color: var(--primary-gold) !important;
    background: rgba(26, 26, 26, 0.7) !important;
}

.dropzone .dz-message {
    color: var(--white) !important;
}

/* Progress Bars */
.progress {
    background-color: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-gold), #d4b654);
    transition: width 0.3s ease;
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: 6px;
}

.badge-gold {
    background-color: var(--primary-gold);
    color: var(--primary-black);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2);
    border-left-color: var(--danger);
    color: #ff6b8a;
}

.alert-success {
    background: rgba(40, 167, 69, 0.2);
    border-left-color: var(--success);
    color: #51cf7a;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border-left-color: var(--warning);
    color: #ffd43b;
}

.alert-info {
    background: rgba(23, 162, 184, 0.2);
    border-left-color: var(--info);
    color: #4dabf7;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }
    
    .stats-value {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        margin: 0;
        border-radius: 15px;
        padding: 1.5rem;
        max-width: none;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
        border: 1px solid rgba(191, 160, 70, 0.2);
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Mobile performance optimizations */
@media (max-width: 600px) {
    /* Disable entrance animations for smoother first paint */
    .fade-in-up, .slide-in-right { animation: none !important; opacity: 1 !important; transform: none !important; }
    /* Reduce card hover transforms & heavy shadows */
    .card { box-shadow: 0 2px 10px rgba(0,0,0,0.4); transition: none; }
    .card:hover { transform: none !important; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
    /* Simplify stats visuals */
    .stats-value { font-size: 1.9rem; }
    /* Prevent table overflow jank */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    /* Lessen backdrop filter cost */
    .navbar-modern, .sidebar, .card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Utility class to programmatically disable animations */
.no-anim * { animation: none !important; transition: none !important; }

/* Sidebar for larger screens */
/* Sidebar (all screens, collapsible on small) */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 250px;
    height: calc(100vh - 64px);
    background: rgba(26, 26, 26, 0.92);
    border-right: 1px solid rgba(191, 160, 70, 0.2);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}
.sidebar.show { transform: translateX(0); }
.sidebar-content { padding: 0.75rem 0 2rem; overflow-y: auto; height: 100%; }
.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.25rem;
    color: var(--white);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
    position: relative;
}
.sidebar-item i { width: 20px; text-align: center; }
.sidebar-item:hover, .sidebar-item.active {
    color: var(--primary-gold);
    background: rgba(191, 160, 70, 0.12);
    border-left-color: var(--primary-gold);
}
@media (min-width: 992px) {
    .sidebar { transform: translateX(0); }
    .main-content.with-sidebar { margin-left: 250px; }
}
/* Adjust main content padding */
.main-content.with-sidebar { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 1200px) { .main-content.with-sidebar { padding-left: 2rem; padding-right: 2rem; } }

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .main-content {
        padding-top: 0 !important;
    }
    
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
