/* EduHub Institute Management System - Main Stylesheet */

/* Import Bootstrap 5 */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

/* Custom CSS Variables - Professional Educational Theme */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --white: #ffffff;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-family-sans: 'Inter', -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border radius */
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
}

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

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--light-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

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

a:hover {
    color: var(--primary-dark);
}

/* Header & Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-600) !important;
    margin: 0 0.5rem;
    transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

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

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

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

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

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

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

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

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

/* Cards */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-control {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
}

/* Tables */
.table {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-800);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #ecfdf5;
    color: var(--success-color);
}

.alert-warning {
    background-color: #fffbeb;
    color: var(--warning-color);
}

.alert-danger {
    background-color: #fef2f2;
    color: var(--danger-color);
}

.alert-info {
    background-color: #f0f9ff;
    color: var(--info-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Course Cards */
.course-card {
    transition: transform 0.2s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.course-original-price {
    font-size: 1rem;
    color: var(--gray-400);
    text-decoration: line-through;
}

/* Dashboard Styles */
.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.dashboard-stat {
    text-align: center;
}

.dashboard-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-stat-label {
    color: var(--gray-600);
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    min-height: 100vh;
    padding: 2rem 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav-item {
    margin-bottom: 0.5rem;
}

.sidebar-nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Footer */
.footer {
    background-color: var(--gray-800);
    color: var(--gray-300);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer h5 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer a {
    color: var(--gray-300);
    text-decoration: none;
}

.footer a:hover {
    color: var(--white);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .sidebar {
        min-height: auto;
    }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-light-gray { background-color: var(--gray-100) !important; }

.border-radius { border-radius: var(--border-radius) !important; }
.border-radius-lg { border-radius: var(--border-radius-lg) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Custom Components */
.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stats-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
}

.progress-custom {
    height: 8px;
    border-radius: var(--border-radius);
    background-color: var(--gray-200);
}

.progress-custom .progress-bar {
    border-radius: var(--border-radius);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
/* Notification Styles */
.notification-dropdown {
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.notification-item {
    border-bottom: 1px solid #f1f5f9;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #f8fafc;
}

.notification-item.unread .dropdown-item:hover {
    background-color: #e2e8f0;
}

.notification-item .dropdown-item {
    white-space: normal;
    padding: 0;
}

.notification-item .dropdown-item:hover {
    background-color: #f1f5f9;
}

#notification-badge {
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Email Template Styles */
.email-template-preview {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    background-color: #f8f9fa;
    max-height: 400px;
    overflow-y: auto;
}

.template-variable {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Queue Status Colors */
.status-pending { color: #f59e0b; }
.status-sending { color: #3b82f6; }
.status-sent { color: #10b981; }
.status-failed { color: #ef4444; }
.status-cancelled { color: #6b7280; }

/* Priority Colors */
.priority-high { color: #dc2626; font-weight: bold; }
.priority-normal { color: #4b5563; }
.priority-low { color: #9ca3af; }

/* Notification Preferences Table */
.table th {
    background-color: #f8f9fa;
    border-top: none;
}

.form-check-input:disabled {
    opacity: 0.3;
}

/* Responsive Notification Dropdown */
@media (max-width: 576px) {
    .notification-dropdown {
        width: 300px !important;
        left: -250px !important;
    }
}

/* Dropdown z-index fixes - Keep dropdowns visible on hover */
.dropdown {
    position: relative;
    z-index: 9998;
}

.dropdown-menu {
    z-index: 9999 !important;
    /* Add a small gap to prevent flickering */
    margin-top: 0;
}

.dropdown-menu.dropdown-menu-end {
    right: 0;
    left: auto;
}

/* Prevent dropdown from closing when moving mouse */
.dropdown-menu {
    pointer-events: auto;
}

.dropdown-toggle::after {
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Ensure proper stacking context for navbar */
.navbar {
    z-index: 9997;
}

/* Fix for sticky elements interfering with dropdowns */
.sticky-top {
    z-index: 9996;
}

.fixed-top {
    z-index: 9996;
}
