/* Custom CSS Variables */
:root {
    --primary-blue: #0054c4;
    --accent-blue: #00a3f8;
    --light-blue: #e6f3ff;
    --dark-blue: #003a8c;
    --gradient-primary: linear-gradient(135deg, #0054c4 0%, #00a3f8 100%);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --bg-glass: rgba(255, 255, 255, 0.25);
    --shadow-soft: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 50px rgba(0, 163, 248, 0.2);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-blue) 0%, rgba(255, 255, 255, 0.9) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Authentication Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: 20px;
}

.auth-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.auth-title {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Improve input field visibility in modals and forms */
.form-control {
    background: #fff;
    border: 2px solid #d1d5db;
    color: var(--text-primary);
    box-shadow: none;
}
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--accent-blue);
    background: #f8fafc;
    color: var(--text-primary);
}

/* Optional: Make select fields match input fields */
.form-select {
    background: #fff;
    border: 2px solid #d1d5db;
    color: var(--text-primary);
    box-shadow: none;
}
.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px var(--accent-blue);
    background: #f8fafc;
    color: var(--text-primary);
}

/* Authentication Form Specific Styles */
.auth-card .form-control,
.auth-card .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 10px 28px;
    width: 100%;
    border-radius: 10px;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 163, 248, 0.2);
    color: var(--text-primary);
}

.auth-card .form-control::placeholder,
.auth-card .form-select::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 163, 248, 0.3);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Layout Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 15px;
}

/* Header Styles */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow-soft);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: var(--light-blue);
    box-shadow: var(--shadow-soft), 2px 0 8px 0 rgba(0, 84, 196, 0.08); /* Add right-side shadow */
    height: calc(100vh - 70px);
    position: fixed;
    left: 0;
    top: 70px;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-nav {
    list-style: none;
    padding: 20px 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--accent-blue);
    color: white;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-blue);
}

.sidebar-nav i {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Sidebar Sections */
.sidebar-section {
    margin-top: 20px;
    margin-bottom: 10px;
}

.sidebar-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 163, 248, 0.1);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    min-height: calc(100vh - 70px);
    padding-bottom: 70px; /* Prevents content from being hidden behind the fixed footer */
    padding-top: 70px; /* Prevents content from being hidden behind the fixed header */
}

.page-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: var(--light-blue);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 163, 248, 0.1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}



/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 70px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 1rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Footer */
.footer {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: 18px 0 16px 0;
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    font-size: 1rem;
    letter-spacing: 0.02em;
}
.footer a {
    color: var(--dark-blue);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 700;
}
.footer a:hover {
    color: #ffe082;
}

/* Offset modals below the fixed header */
.modal-dialog {
    margin-top: 100px;
}