/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
    --purple-900: #663D7D;
    --purple-800: #B084B8;
    --purple-700: #583A78;
    --purple-600: #65377A;
    --purple-500: #AB31CC;
    --purple-400: #AB47BC;
    --purple-300: #CBA1D4;
    --purple-200: #E1BEE7;
    --purple-100: #F3E5F5;
    --purple-50: #F8F0FA;
    --silver-300: #B0B0B0;
    --silver-200: #D0D0D0;
    --silver-100: #E8E8E8;
    --silver-50: #F5F5F5;
    --white: #FFFFFF;
    --black: #1A1A2E;
    --text-primary: #1A0533;
    --text-secondary: #4A4A6A;
    --shadow-color: rgba(74, 20, 140, 0.25);
    --shadow-sm: 0 2px 8px rgba(74, 20, 140, 0.12);
    --shadow-md: 0 4px 20px rgba(74, 20, 140, 0.18);
    --shadow-lg: 0 8px 40px rgba(74, 20, 140, 0.25);
    --shadow-xl: 0 12px 60px rgba(74, 20, 140, 0.35);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--purple-50) 0%, var(--silver-50) 100%);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}
html[dir="ltr"] body { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }

/* ========================================
   CONTAINER
   ======================================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER (شعار المدرسة)
   ======================================== */
.header {
    background: linear-gradient(145deg, var(--purple-800), var(--purple-700));
    padding: 18px 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-bottom: 3px;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}
.header-content1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 16px;
    position: relative;
    z-index: 1;
}
.logo-container { flex-shrink: 0; }
.school-logo {
    height: 65px;
    width: auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: var(--white);
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}
.school-logo:hover {
    transform: scale(1.05) rotate(-5deg);
    border-color: rgba(255, 255, 255, 0.6);
}
.school-name { flex: 1; text-align: center; }
.school-name h1 {
    color: var(--white);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #FFFFFF, var(--silver-200));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.school-name h2 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ========================================
   SITE HEADER (شريط التنقل)
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--purple-100);
    box-shadow: var(--shadow-sm);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
    color: var(--white);
    display: grid; place-items: center;
    font-weight: 700; font-size: 20px;
    box-shadow: var(--shadow-md);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-weight: 700; color: var(--purple-700); font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-secondary); }

.main-nav { display: flex; gap: 22px; margin-inline-start: auto; }
.main-nav a {
    font-weight: 600; font-size: 14px; color: var(--text-secondary);
    padding: 8px 4px; position: relative;
    transition: var(--transition);
}
.main-nav a:hover { color: var(--purple-500); }
.main-nav a::after {
    content: ''; position: absolute; bottom: 0; inset-inline: 0;
    height: 2px; background: var(--purple-500);
    transform: scaleX(0); transform-origin: center;
    transition: var(--transition);
}
.main-nav a:hover::after { transform: scaleX(1); }

.lang-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    background: var(--purple-100); color: var(--purple-700);
    font-weight: 600; font-size: 13px; cursor: pointer;
    border: 1px solid var(--purple-200);
    transition: var(--transition);
}
.lang-btn:hover { background: var(--purple-200); box-shadow: var(--shadow-sm); }

/* ========================================
   LAYOUT
   ======================================== */
.site-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 15px 24px 10px;   /* ← قلّلنا من 40px إلى 15px */
    width: 100%;
    flex: 1;
}

.hero {
    text-align: center;
    padding: 0;                 /* ← أزلنا الـ padding */
    margin-top: -15px;           /* ← رفع خفيف إضافي */
}
.hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700; color: var(--purple-600);
    margin-bottom: 2px;
}
.hero p { color: var(--text-secondary); font-size: 16px; }

.section { margin-bottom: 10px; }
.section-head {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 16px;
}
.section-head h2 {
    font-size: clamp(20px, 2vw, 26px);
    color: var(--purple-600); font-weight: 700;
}
.count-badge {
    background: var(--purple-500); color: var(--white);
    font-size: 12px; font-weight: 700;
    padding: 3px 12px; border-radius: 999px;
}

/* ========================================
   JOB CARDS GRID
   ======================================== */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}
.jobs-grid--muted { opacity: 0.75; }

.job-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--purple-100);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}
.job-card::before {
    content: ''; 
	position: absolute; top: 0; inset-inline: 0;
    height: 4px;
    height: 4px;
    background: linear-gradient(90deg, var(--purple-500), var(--purple-300));
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: var(--transition);
}
.job-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--purple-300);
}
.job-card:hover::before { transform: scaleX(1); }
.job-card--closed { cursor: pointer; }
.job-card--closed:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.job-card-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.job-code {
    font-size: 12px; font-weight: 700;
    color: var(--purple-600);
    background: var(--purple-100);
    padding: 4px 10px; border-radius: 6px;
}
.job-status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 0 4px rgba(34,197,94,0.15);
}
.job-status-dot--closed {
    background: var(--silver-300);
    box-shadow: 0 0 0 4px rgba(176,176,176,0.15);
}
.job-title {
    font-size: 18px; font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.job-shortdesc {
    color: var(--text-secondary); font-size: 14px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-grow: 1;
}
.job-card-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--purple-50);
    font-size: 13px;
}
.job-location { color: var(--text-secondary); }
.job-cta { color: var(--purple-500); font-weight: 700; }

/* ========================================
   JOB DETAILS
   ======================================== */
.job-details {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid var(--purple-100);
}
.job-details-head {
    margin-bottom: 30px; padding-bottom: 20px;
    border-bottom: 1px solid var(--purple-100);
}
.job-code-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
    color: var(--white);
    padding: 6px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 700;
    margin-bottom: 12px;
}
.job-details-title {
    font-size: clamp(22px, 3vw, 32px);
    color: var(--purple-700);
    margin-bottom: 10px;
    word-wrap: break-word;
}
.job-location-badge { color: var(--text-secondary); font-size: 14px; }

.job-details-body { display: flex; flex-direction: column; gap: 26px; }
.jd-block h2 {
    font-size: 18px; color: var(--purple-600);
    margin-bottom: 10px; font-weight: 700;
    padding-inline-start: 12px;
    border-inline-start: 4px solid var(--purple-400);
}
.jd-content {
    color: var(--text-secondary); font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.8;
}
.job-details-actions {
    display: flex; gap: 14px; flex-wrap: wrap;
    margin-top: 34px; padding-top: 24px;
    border-top: 1px solid var(--purple-100);
}

/* ========================================
   JOB PERIOD (تاريخ بداية ونهاية الإعلان)
   ======================================== */
.job-period {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--purple-50), var(--silver-50));
    border: 1px solid var(--purple-200);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.job-period-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.job-period-label {
    font-weight: 600;
    color: var(--purple-700);
}

.job-period-value {
    font-weight: 700;
    color: var(--purple-600);
    background: var(--white);
    padding: 3px 10px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.job-period-sep {
    color: var(--purple-300);
    font-weight: 700;
}

/* على الموبايل: كل عنصر في سطر */
@media (max-width: 600px) {
    .job-period {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .job-period-sep { display: none; }
}

/* ========================================
   FORMS
   ======================================== */
.form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--purple-100);
    margin-bottom: 26px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
    font-weight: 600; font-size: 14px; color: var(--text-primary);
}
.req { color: #DC2626; font-weight: 700; }

.input, .input-file {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--purple-100);
    border-radius: var(--radius-sm);
    background: var(--silver-50);
    font-family: inherit; font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}
.input:focus {
    outline: none;
    border-color: var(--purple-400);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--purple-100);
}
.input-otp {
    font-size: 24px; letter-spacing: 12px;
    text-align: center; font-weight: 700;
}
.input-file { padding: 10px; cursor: pointer; }
.field-hint { font-size: 12px; color: var(--text-secondary); }
.divider {
    border: none; border-top: 1px solid var(--purple-100);
    margin: 28px 0;
}
.subsection-title {
    font-size: 17px; color: var(--purple-700);
    margin-bottom: 16px; font-weight: 700;
}
.muted { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--purple-500), var(--purple-700));
    color: var(--white);
    box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-ghost {
    background: var(--purple-100);
    color: var(--purple-700);
    border: 1px solid var(--purple-200);
}
.btn-ghost:hover { background: var(--purple-200); }
.btn-lg { padding: 14px 30px; font-size: 15px; }

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    margin-bottom: 22px;
    border-inline-start: 4px solid;
}
.alert-error { background: #FEF2F2; color: #991B1B; border-color: #DC2626; }
.alert-success { background: #F0FDF4; color: #166534; border-color: #22C55E; }

/* ========================================
   SUCCESS PAGE
   ======================================== */
.success-wrap {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 640px;
    margin: 0 auto;
}
.success-check { width: 120px; height: 120px; margin: 0 auto 24px; }
.check-svg { width: 100%; height: 100%; }
.check-circle {
    stroke: var(--purple-500); stroke-width: 2;
    stroke-dasharray: 166; stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65,0,0.45,1) forwards;
}
.check-mark {
    stroke: var(--purple-500); stroke-width: 4;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: stroke 0.4s cubic-bezier(0.65,0,0.45,1) 0.6s forwards;
}
@keyframes stroke { to { stroke-dashoffset: 0; } }
.success-title {
    font-size: clamp(22px, 3vw, 30px);
    color: var(--purple-700); margin-bottom: 12px;
}
.success-sub { color: var(--text-secondary); margin-bottom: 28px; }
.success-sn {
    display: inline-flex; flex-direction: column; gap: 6px;
    background: var(--purple-50);
    border: 2px dashed var(--purple-300);
    border-radius: var(--radius-md);
    padding: 20px 40px; margin-bottom: 32px;
}
.sn-label { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.sn-value {
    font-size: 32px; font-weight: 700; color: var(--purple-600);
    letter-spacing: 2px;
}
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ========================================
   APPS TABLE
   ======================================== */
.apps-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.apps-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    min-width: 720px;
}
.apps-table th, .apps-table td {
    padding: 14px 16px;
    text-align: start;
    border-bottom: 1px solid var(--purple-50);
    font-size: 14px;
}
.apps-table th {
    background: var(--purple-50);
    color: var(--purple-700); font-weight: 700;
    font-size: 13px;
}
.apps-table tr:hover { background: var(--purple-50); }
.status-pill {
    display: inline-block;
    padding: 4px 12px; border-radius: 999px;
    background: var(--purple-100); color: var(--purple-700);
    font-size: 12px; font-weight: 700;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--purple-200);
}
.empty-icon { font-size: 48px; margin-bottom: 6px; }
.empty-state p { color: var(--text-secondary); font-size: 15px; }

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background: var(--purple-700);
    color: var(--purple-100);
    padding: 24px;
    text-align: center;
    font-size: 13px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }

.footer {
    background: linear-gradient(145deg, var(--purple-800), var(--purple-900));
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 24px 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: auto;
    font-size: 14px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.footer p { opacity: 0.8; letter-spacing: 0.5px; }

/* ========================================
   RESPONSIVE
   ======================================== */

/* شاشات متوسطة (تابلت) */
@media (max-width: 900px) {
    .header-inner { padding: 10px 16px; gap: 12px; }
    .site-main { padding: 24px 16px 40px; }
    .job-details,
    .form-card,
    .success-wrap { padding: 24px; }
    .jobs-grid { gap: 18px; }
	.lang-btn{display: inline-flex; align-items: center; gap: 8px;
		padding: 8px 8px; border-radius: var(--radius-sm);
		background: var(--purple-100); color: var(--purple-700);
		font-weight: 700; font-size: 12px; cursor: pointer;
		border: 1px solid var(--purple-200);
		transition: var(--transition);}

    /* اجعل الهيدر يلتف بدل الاختفاء */
    .header-inner {
        flex-wrap: wrap;
    }

    /* شريط التنقل يأخذ عرض كامل في سطر منفصل */
    .main-nav {
        display: flex;
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 16px;
        padding-top: 8px;
        margin-inline-start: 0;
        border-top: 1px solid var(--purple-100);
    }

    .main-nav a {
        font-size: 13px;
        padding: 6px 8px;
    }
}

/* شاشات صغيرة (موبايل) */
@media (max-width: 600px) {
    .jobs-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .hero { padding: 5px 12px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .success-sn { padding: 16px 24px; }
    .sn-value { font-size: 24px; }
    .brand-sub { display: none; }
	.lang-btn{display: inline-flex; align-items: center; gap: 3px;
		padding: 2px 3px; border-radius: var(--radius-sm);
		background: var(--purple-100); color: var(--purple-700);
		font-weight: 700; font-size: 12px; cursor: pointer;
		border: 1px solid var(--purple-200);
		transition: var(--transition);}
    /* تصغير شريط التنقل */
    .main-nav {
        gap: 10px;
    }

    .main-nav a {
        font-size: 12px;
        padding: 5px 6px;
    }

    .apps-table { min-width: 0; }
    .apps-table thead { display: none; }
    .apps-table,
    .apps-table tbody,
    .apps-table tr,
    .apps-table td { display: block; width: 100%; }
    .apps-table tr {
        margin-bottom: 14px;
        background: var(--purple-50);
        border-radius: var(--radius-sm);
        padding: 12px;
    }
    .apps-table td {
        border: none;
        padding: 8px 4px;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        text-align: end;
    }
    .apps-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--purple-700);
        font-size: 12px;
        text-align: start;
    }
}

/* شاشات صغيرة جدًا */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .school-name h1 { font-size: 17px; }
    .school-name h2 { font-size: 10px; letter-spacing: 1px; }
    .school-logo { height: 40px; }
    .header-content1 { justify-content: center; text-align: center; }
    .jobs-grid { gap: 14px; }
    .job-card { padding: 18px; min-height: 200px; }
	.lang-btn{display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 3px; border-radius: var(--radius-sm);
    background: var(--purple-100); color: var(--purple-700);
    font-weight: 700; font-size: 12px; cursor: pointer;
    border: 1px solid var(--purple-200);
    transition: var(--transition);}

    .main-nav a {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* ========================================
   DECLARATION BOX
   ======================================== */
.declaration-box {
    background: var(--purple-50);
    border: 2px solid var(--purple-200);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin: 20px 0;
}

.declaration-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.declaration-checkbox {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    accent-color: var(--purple-500);
    cursor: pointer;
    flex-shrink: 0;
}

.declaration-text {
    flex: 1;
    font-weight: 500;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}