/**
 * Majmaah University LMS - Unified Theme
 * Green & Gold Premium Design System
 * Version: 2.0
 * 
 * Colors:
 * - Primary Green: #0E5F48
 * - Accent Gold: #C5982D
 */

/* ============================================
   1. CSS VARIABLES (ROOT)
   ============================================ */
:root {
    /* Primary Colors - Majmaah Green */
    --primary: #0E5F48;
    --primary-light: #167d60;
    --primary-dark: #084232;

    /* Accent Colors - Majmaah Gold */
    --accent: #C5982D;
    --accent-light: #d9b154;
    --accent-dark: #a17c24;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Neutral Colors */
    --dark: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --light: #f8fafc;
    --border: #e2e8f0;

    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --glass: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.8);

    /* Shadows - Soft & Elegant */
    --shadow-sm: 0 2px 6px rgba(14, 95, 72, 0.06);
    --shadow: 0 4px 12px rgba(14, 95, 72, 0.08);
    --shadow-md: 0 6px 16px rgba(14, 95, 72, 0.1);
    --shadow-lg: 0 8px 20px rgba(14, 95, 72, 0.12);
    --shadow-xl: 0 12px 30px rgba(14, 95, 72, 0.15);

    /* Gold Shadows */
    --shadow-gold: 0 3px 10px rgba(197, 152, 45, 0.2);
    --shadow-gold-lg: 0 5px 15px rgba(197, 152, 45, 0.3);

    /* Border Radius - Refined */
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* Spacing - Reduced for elegance */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing: 1rem;
    --spacing-md: 1.25rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Typography */
    --font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* ============================================
   2. GLOBAL STYLES
   ============================================ */
body {
    background: var(--bg-gradient);
    font-family: var(--font-family);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================
   GLOBAL SCROLLBARS
   ============================================ */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 95, 72, 0.28) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(14, 95, 72, 0.28);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.75);
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 95, 72, 0.45);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1,
.h1 {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

h2,
.h2 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

h3,
.h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

h4,
.h4 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

h5,
.h5 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

h6,
.h6 {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.text-primary {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   4. BUTTONS - Refined & Elegant
   ============================================ */

/* Primary Button - Green */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

/* Accent Button - Gold */
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold-lg);
    color: #fff;
}

/* Outline Buttons */
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.btn-outline-accent {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-outline-accent:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Small Buttons */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius);
}

/* Large Buttons */
.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ============================================
   5. FORM ELEMENTS
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 152, 45, 0.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ============================================
   6. CARDS & CONTAINERS
   ============================================ */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Glass Card */
.card-glass {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

/* ============================================
   7. BADGES & PILLS
   ============================================ */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-primary {
    background: rgba(14, 95, 72, 0.1);
    color: var(--primary);
}

.badge-accent {
    background: rgba(197, 152, 45, 0.1);
    color: var(--accent-dark);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* ============================================
   8. TABLES
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: rgba(197, 152, 45, 0.06);
    border: none;
    color: var(--accent-dark);
    font-weight: 700;
    padding: 1rem 0.9rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.025em;
}

.table tbody td {
    padding: 1rem 0.9rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(197, 152, 45, 0.03);
    transition: background-color 0.2s ease;
}

/* ============================================
   9. MODALS
   ============================================ */
.modal-content {
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.75rem;
}

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

.modal-title {
    font-weight: 600;
    font-size: 1.15rem;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid #f1f5f9;
}

/* ============================================
   10. ALERTS
   ============================================ */
.alert {
    border-left: 4px solid;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.alert-info {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(14, 95, 72, 0.05), rgba(14, 95, 72, 0.02));
    color: var(--text-primary);
}

.alert-warning {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(197, 152, 45, 0.08), rgba(197, 152, 45, 0.03));
    color: var(--text-primary);
}

.alert-success {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
    color: var(--text-primary);
}

/* ============================================
   11. PROGRESS BARS
   ============================================ */
.progress {
    height: 10px;
    border-radius: var(--radius);
    background: #e5e7eb;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.5s ease;
    box-shadow: 0 2px 8px rgba(197, 152, 45, 0.3);
}

/* ============================================
   12. AVATARS
   ============================================ */
.avatar {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: var(--shadow-gold);
    overflow: hidden;
}

.avatar-sm {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
}

.avatar-md {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
}

.avatar-lg {
    width: 65px;
    height: 65px;
    font-size: 1.5rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   13. PAGE HEADERS
   ============================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at top right, rgba(197, 152, 45, 0.2), transparent 40%);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* ============================================
   14. UTILITY CLASSES
   ============================================ */

/* Shadows */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

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

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* Border Radius */
.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded {
    border-radius: var(--radius);
}

.rounded-md {
    border-radius: var(--radius-md);
}

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

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-2xl {
    border-radius: var(--radius-2xl);
}

/* Backgrounds */
.bg-primary {
    background-color: var(--primary);
}

.bg-accent {
    background-color: var(--accent);
}

.bg-light {
    background-color: var(--light);
}

/* Text Colors */
.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

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

/* ============================================
   15. ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

/* ============================================
   16. RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {

    h1,
    .h1 {
        font-size: 1.5rem;
    }

    h2,
    .h2 {
        font-size: 1.3rem;
    }

    h3,
    .h3 {
        font-size: 1.15rem;
    }

    .page-header {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   17. SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--accent-dark));
}
