/* Base Styles & Variables */
:root {
    --primary-color: #0056b3;
    /* Deep Blue */
    --secondary-color: #f1c40f;
    /* Gold for accents */
    --accent-color: #e74c3c;
    /* Red for alerts/important */
    --text-color: #333;
    --bg-color: #f4f6f9;
    --header-bg: #fff;
    --sidebar-bg: #fff;
    --card-bg: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    direction: rtl;
    /* Arabic support */
    text-align: right;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify_content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

/* Header */
header {
    background: var(--header-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 60px;
}

.nav-menu a {
    margin-left: 15px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-menu a:hover {
    background: #eef2f7;
}

/* News Ticker */
.news-ticker-wrap {
    background: #333;
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 3px solid var(--secondary-color);
}

.ticker-content {
    display: inline-block;
    animation: ticker 30s linear infinite;
}

@keyframes ticker {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Main Content Area */
.main-wrapper {
    display: flex;
    margin-top: 20px;
    gap: 20px;
    flex: 1;
    /* Pushes footer down */
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.content {
    flex-grow: 1;
}

/* Sidebar Widgets */
.widget {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--primary-color);
}

.stats-counter {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: #28a745;
}

/* Official Documents (Print Styles) */
.official-doc {
    background: #fff;
    padding: 40px;
    border: 1px solid #ddd;
    margin: 20px auto;
    max-width: 210mm;
    /* A4 width */
    min-height: 297mm;
    /* A4 height */
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Handwritten Font Simulate */
@font-face {
    font-family: 'HandwrittenAr';
    src: url('https://fonts.gstatic.com/s/arefruqaa/v13/WwkYxPq1XyvX6Xw1Y-rV_y4.woff2') format('woff2');
    /* Fallback to Aref Ruqaa manually if needed, will import in header */
}

.handwritten {
    font-family: 'Aref Ruqaa', serif;
    font-size: 1.2rem;
    color: #000080;
    /* Blue ink color */
}

/* Print Media Query */
@media print {
    body {
        background: #fff;
        margin: 0;
        padding: 0;
        display: block;
    }

    header,
    footer,
    .sidebar,
    .news-ticker-wrap,
    .no-print,
    .app-footer {
        display: none !important;
    }

    .main-wrapper {
        display: block;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .official-doc {
        border: none;
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
    }

    .page-break {
        page-break-after: always;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Stats Dashboard */
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Modern Footer Styles */
.app-footer {
    background: #1a1e26;
    color: #e2e8f0;
    font-family: 'Cairo', sans-serif;
    position: relative;
    padding: 0;
    margin-top: auto;
    width: 100%;
}

.footer-glow-border {
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-brand-icon {
    width: 48px;
    height: 48px;
    color: #60a5fa;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.footer-desc {
    color: #94a3b8;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-title-icon {
    margin-left: 0.5rem;
    color: #60a5fa;
}

.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #cbd5e1;
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-item:hover {
    color: #60a5fa;
    transform: translateX(-5px);
}

.contact-icon-box {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-link span {
    display: none;
}

.social-link:hover {
    transform: translateY(-3px);
    color: #fff;
}

.social-facebook:hover {
    background: #1877f2;
}

.social-twitter:hover {
    background: #1da1f2;
}

.social-instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-linkedin:hover {
    background: #0077b5;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 3rem 0 1.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.footer-credit a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
}

.footer-credit a:hover {
    text-decoration: underline;
}