:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-nav: rgba(15, 23, 42, 0.8);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --font-family: 'Tajawal', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Header & Hero */
header {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

/* Navigation */
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Hero Section */
.hero {
    padding: 100px 0;
    text-align: center;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 25px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 30px;
}

/* News Ticker */
.news-ticker-container {
    background: var(--bg-card);
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.news-label {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    z-index: 2;
    font-weight: bold;
    display: flex;
    align-items: center;
    box-shadow: 10px 0 20px rgba(0,0,0,0.5);
}

.news-ticker {
    display: inline-block;
    padding-right: 150px;
}

.news-ticker.rtl {
    animation: ticker-rtl var(--ticker-speed, 30s) linear infinite;
}

.news-ticker.ltr {
    animation: ticker-ltr var(--ticker-speed, 30s) linear infinite;
}

/* Pause on hover for accessibility */
.news-ticker:hover {
    animation-play-state: paused;
}

.news-item {
    display: inline-block;
    margin-left: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.news-item::after {
    content: '•';
    margin-right: 25px;
    color: var(--primary);
}

@keyframes ticker-rtl {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes ticker-ltr {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.service-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    position: relative;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.service-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.service-content {
    padding: 25px;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.service-stats {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Blocks & Ads */
.sidebar-block {
    margin-bottom: 30px;
    padding: 20px;
}

.block-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.ad-box {
    width: 100%;
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
}

/* Contact Page */
.contact-form {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Footer Styles provided by user integrated */
.footer {
    background: #0a0f1a;
    padding: 60px 0 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: white;
    transition: 0.3s;
    text-decoration: none;
}

.social-icon:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

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

.animate-fade {
    animation: fadeIn 0.8s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* Site Footer (Coordinated with Site Theme) */
.site-footer {
    margin-top: 100px;
    background: #0a0f1e;
    color: #fff;
    padding-bottom: 20px;
    border-top: 2px solid var(--glass-border);
}

.stats-bar {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 40px;
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: -35px auto 60px;
    width: fit-content;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    flex-wrap: wrap;
}

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

.stat-item .val {
    color: #fff;
    font-weight: 900;
    margin-right: 8px;
}

.footer-columns {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    padding-bottom: 50px;
    text-align: right;
}

.footer-col h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-main);
}

.branding-col .site-desc {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1.05rem;
    max-width: 450px;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-list li {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
    font-weight: 500;
}

.contact-list li i {
    width: 38px;
    height: 38px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.icon-circle {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: 0.4s;
    border: 1px solid var(--glass-border);
    text-decoration: none;
}

.icon-circle:hover {
    background: var(--gradient);
    color: #fff;
    transform: translateY(-8px);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.copyright-strip {
    border-top: 1px solid var(--glass-border);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 1rem;
}

.dev-name {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 992px) {
    .footer-columns { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .contact-list li { justify-content: center; }
    .social-icons { justify-content: center; }
    .branding-col .site-desc { margin: 0 auto; }
    .stats-bar { gap: 20px; padding: 15px; }
    .copyright-strip { flex-direction: column; gap: 15px; }
}

.lang-switcher .glass {
    transition: 0.3s;
    font-weight: 800;
}
.lang-switcher .glass.active {
    background: var(--gradient);
    border-color: transparent;
}
.lang-switcher .glass:hover {
    transform: scale(1.1);
}

[dir="ltr"] .contact-list li {
    justify-content: flex-start;
}
[dir="ltr"] .footer-columns {
    text-align: left;
}
[dir="ltr"] .branding-col .site-desc {
    margin-left: 0;
}
[dir="ltr"] .social-icons {
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .hero { padding: 40px 0; }
    .hero h1 { font-size: 2rem !important; }
    .hero-card { padding: 30px 20px !important; border-radius: 20px !important; margin: 0 10px; }
    .hero p { font-size: 1rem !important; }
    .services-grid { grid-template-columns: 1fr; gap: 20px; }
    .stats-bar { padding: 15px; gap: 10px; width: 90%; margin-top: -20px; }
    .stat-item { font-size: 0.8rem; }
    .container { padding: 0 15px; }
    
    .footer-columns { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .contact-list li { justify-content: center; }
    .social-icons { justify-content: center; }
    
    .news-label { padding: 8px 12px; font-size: 0.8rem; }
    .news-ticker-container { height: 40px; display: flex; align-items: center; }
    
    .lang-switcher { 
        top: auto !important; 
        bottom: 20px !important; 
        flex-direction: row !important; 
        width: 100%; 
        justify-content: center; 
        left: 0 !important; 
        right: 0 !important; 
    }
}

/* Admin Responsive Overrides */
body.admin-body {
    display: flex;
    min-height: 100vh;
}

@media (max-width: 1024px) {
    body.admin-body {
        flex-direction: column;
    }
    .sidebar {
        width: 100% !important;
        height: auto !important;
        position: static !important;
        padding: 15px !important;
        flex-direction: row !important;
        overflow-x: auto;
        white-space: nowrap;
        border-bottom: 1px solid var(--glass-border);
    }
    .sidebar nav {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    .nav-item {
        margin-bottom: 0 !important;
        padding: 10px 15px !important;
    }
    .main-content {
        padding: 20px !important;
    }
    .table-container {
        overflow-x: auto;
    }
    .sidebar h3, .sidebar img { display: none; }
}

/* Mobile Menu for Header */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0f172a;
        padding: 20px;
        border-bottom: 1px solid var(--glass-border);
    }
    header nav.active { display: block; }
    header nav ul { flex-direction: column; gap: 15px; }
}
