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

:root {
    /* 2030 Light Palette */
    --primary-color: #6366f1; /* Modern Indigo */
    --primary-hover: #4f46e5;
    --secondary-color: #64748b; /* Slate Gray */
    --success-color: #10b981;
    --danger-color: #ef4444;
    
    --bg-color: #fbfcff; /* Crisp Light Background */
    --card-bg: #ffffff;
    --text-color: #0f172a; /* Deep Slate Text */
    --text-muted: #64748b;
    --border-color: #f1f5f9;
    --input-bg: #f8fafc;

    /* 2030 Geometry & Shadows */
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    
    --shadow-premium: 0 20px 50px -12px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: blur(12px);
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    text-align: right;
    direction: rtl;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
}
html { overflow-x: hidden; max-width: 100vw; }

.container {
    width: 92%;
    max-width: 1300px;
    margin: 0 auto;
}

/* NAVBAR & NAVIGATION */
.top-bar {
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 0;
    font-size: 0.82rem;
    color: var(--secondary-color);
    font-weight: 500;
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar.scrolled {
    padding: 12px 0;
    background: #ffffff;
    box-shadow: var(--shadow-premium);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.85rem;
    font-weight: 900;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.category-nav {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Hide scrollbar for clean look */
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-left: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}
.category-nav a:hover { color: var(--primary-color); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links a:not(.btn) {
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.3s;
    border-radius: var(--radius-sm);
}
.nav-links a:not(.btn):hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: white !important; 
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover { 
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 35px -10px rgba(99, 102, 241, 0.5);
}

.btn-outline { 
    background: white; 
    border: 2px solid var(--border-color); 
    color: var(--text-color); 
}
.btn-outline:hover { 
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.08);
}

/* FORMS */
.form-group { margin-bottom: 25px; }
.form-group label { display: block; margin-bottom: 12px; font-weight: 800; color: #1e293b; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
    color: var(--text-color);
}
.form-control:focus { 
    outline: none; 
    border-color: var(--primary-color); 
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* DASHBOARD */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}
@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: 0.3s;
}
.sidebar-link:hover, .sidebar-link.active {
    background: #eef2ff;
    color: var(--primary-color);
}

/* SERVICE CARDS (2030 Light) */
.service-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--primary-color);
}
.service-card img {
    transition: transform 0.6s ease;
}
.service-card:hover img {
    transform: scale(1.05);
}

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.badge-primary { background: #eef2ff; color: var(--primary-color); }
.badge-success { background: #f0fdf4; color: var(--success-color); }

/* TABLE & RESPONSIVENESS */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
th, td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}
th {
    background: #f8fafc;
    font-weight: 800;
    color: #475569;
}
td { font-weight: 500; }

@media (max-width: 768px) {
    .card { padding: 15px; }
    .container { width: 98%; overflow-x: hidden; }
    .dashboard-grid { gap: 15px; }
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.1rem !important; }
    .table-responsive { width: 100%; border-radius: 8px; }
    table { min-width: 600px; }
    th, td { padding: 10px; font-size: 0.85rem; }
}

footer {
    background: #0f172a;

    color: #94a3b8;
    padding: 80px 0 40px;
    margin-top: 80px;
}
footer h3 { color: white; margin-bottom: 25px; font-weight: 900; }
footer a { color: #cbd5e1; text-decoration: none; transition: 0.3s; }
footer a:hover { color: white; }

/* CATEGORY GRID (2030) */
.category-blocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}
@media (min-width: 768px) {
    .category-blocks-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .category-blocks-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}
@media (min-width: 1200px) {
    .category-blocks-grid { grid-template-columns: repeat(6, 1fr); }
}
.category-block {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border-radius: var(--radius-lg);
    color: #020617;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
    min-height: 110px;
    border: 1px solid rgba(255,255,255,0.6);
    font-size: 1.1rem;
    line-height: 1.4;
    background-size: 200% 200%;
}
.category-block:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-premium);
    background-position: right center;
}
