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

:root {
    /* Rich dark theme colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #020617 100%);
    
    /* Vibrant acccents */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #8b5cf6;
    
    /* Status colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Text colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-family: 'Tajawal', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Glassmorphism Container */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    animation: fadeInUp 0.6s ease-out forwards;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem;
}

/* Header & Nav */
header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: fadeInDown 0.5s ease-out;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 60%;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

h2 { font-size: 2rem; color: #fff; }
h3 { font-size: 1.5rem; color: #f8fafc; }

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

.text-gradient {
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

input, select, textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: white; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }

.btn:active {
    transform: translateY(1px);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.25rem;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
}

th {
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* Grid & Cards */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Badges */
.badge {
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-pending { 
    background: rgba(245, 158, 11, 0.15); 
    color: #fbbf24; 
    border: 1px solid rgba(245, 158, 11, 0.3); 
}
.badge-approved { 
    background: rgba(16, 185, 129, 0.15); 
    color: #34d399; 
    border: 1px solid rgba(16, 185, 129, 0.3); 
}
.badge-rejected { 
    background: rgba(239, 68, 68, 0.15); 
    color: #f87171; 
    border: 1px solid rgba(239, 68, 68, 0.3); 
}

/* Stat Cards */
.stat-card {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    margin: 1rem 0 0.5rem;
    background: linear-gradient(135deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* MM Folder Style */
.folder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(180deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.8) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.folder-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.folder-card:hover {
    transform: translateY(-8px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.1);
}

.folder-card:hover::after {
    opacity: 1;
}

.folder-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
    z-index: 1;
}

.folder-card:hover .folder-icon {
    transform: scale(1.1);
}

.folder-title {
    font-size: 1.25rem;
    font-weight: 800;
    z-index: 1;
}

.folder-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    z-index: 1;
}

/* Responsive Design for Mobile/Tablets */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    .glass-panel {
        padding: 1.5rem;
        border-radius: 16px;
    }
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .nav-links a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    .grid {
        gap: 1rem;
    }
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    form[style*="display: flex"], form[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .form-group {
        width: 100% !important;
        flex: none !important;
        margin-bottom: 1rem !important;
    }
    .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    .stat-card {
        padding: 1.5rem;
    }
    .stat-value {
        font-size: 2rem !important;
    }
    .folder-card {
        padding: 1.5rem 1rem;
    }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .table-container th, .table-container td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}
