/* ============================================================
   نظام التصميم الموحد - منصة الورش
   ============================================================ */

:root {
    --bg: #f6f2ea;
    --surface: #fffaf3;
    --surface-2: #efe8dc;
    --ink: #15171a;
    --muted: #5f6368;
    --line: #e0d8ca;
    --accent: #a94f35;
    --accent-soft: rgba(169, 79, 53, 0.10);
    --olive: #2f5d50;
    --gold: #b98a44;
    --shadow: 0 18px 50px rgba(28, 24, 18, 0.10);
    --radius-lg: 28px;
    --radius-md: 18px;
    --font-display: 'Readex Pro', 'Tajawal', system-ui, sans-serif;
    --font-body: 'Tajawal', 'Readex Pro', system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg: #0e1013;
    --surface: #151920;
    --surface-2: #1b2028;
    --ink: #f1ece3;
    --muted: #a3a8b0;
    --line: #262c35;
    --accent: #d18b62;
    --accent-soft: rgba(209, 139, 98, 0.12);
    --olive: #78b39d;
    --gold: #d6b36f;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
}

html.no-transition,
html.no-transition *,
html.no-transition *::before,
html.no-transition *::after {
    transition: none !important;
    animation: none !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img, video, iframe { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }

.container {
    width: min(1240px, calc(100% - 32px));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    top: -100px;
    right: 16px;
    background: var(--ink);
    color: var(--bg);
    padding: 10px 16px;
    border-radius: 10px;
    z-index: 10001;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* ================= الهيدر ================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px 6px 14px 6px;
    background: var(--ink);
    color: var(--bg);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 20%, transparent);
    flex-shrink: 0;
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-text small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--muted);
}

.site-nav { display: flex; align-items: center; gap: 22px; }

.site-nav a {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
    padding-block: 6px;
}

.site-nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a:hover::after, .site-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

.menu-toggle { display: none; }

.theme-light-icon, .theme-dark-icon { display: none; }
[data-theme="light"] .theme-dark-icon { display: block; }
[data-theme="dark"] .theme-light-icon { display: block; }

.mobile-menu {
    display: none;
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 14px 18px 18px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
    display: block;
    padding: 12px 10px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--surface-2); color: var(--ink); }
.mobile-menu-divider { height: 1px; background: var(--line); margin: 10px 0; }

/* ================= الأزرار ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.96rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-full { width: 100%; }

/* ================= عناصر عامة ================= */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.88rem;
    margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--accent); }

.section { padding: 54px 0 70px; }

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 2.6vw, 2.35rem);
    letter-spacing: -0.035em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.section-desc { color: var(--muted); max-width: 620px; }

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 34px 10px 34px 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-head {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.panel-body { padding: 24px; }

.page-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.page-subtitle { color: var(--muted); }

/* ================= الشارات ================= */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    border: 1px solid transparent;
}
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.status-running   { color: #1f7a55; background: rgba(31,122,85,.10);  border-color: rgba(31,122,85,.18); }
.status-available { color: #245fa8; background: rgba(36,95,168,.10);  border-color: rgba(36,95,168,.18); }
.status-full      { color: #b25e00; background: rgba(178,94,0,.10);   border-color: rgba(178,94,0,.18); }
.status-completed { color: #6b4bb8; background: rgba(107,75,184,.10); border-color: rgba(107,75,184,.18); }
.status-ended     { color: #a33b3b; background: rgba(163,59,59,.10);  border-color: rgba(163,59,59,.18); }
.status-unknown   { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

[data-theme="dark"] .status-running   { color: #65d3a8; }
[data-theme="dark"] .status-available { color: #70aefc; }
[data-theme="dark"] .status-full      { color: #ffb04d; }
[data-theme="dark"] .status-completed { color: #b79cff; }
[data-theme="dark"] .status-ended     { color: #ff8b8b; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}
.chip svg { width: 14px; height: 14px; }

.badges-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ================= بطاقات الورش ================= */
.workshops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.workshop-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 30px 10px 30px 10px;
    padding: 14px;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.workshop-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.card-media-wrap { position: relative; margin-bottom: 14px; }

.card-status { position: absolute; top: 12px; right: 12px; z-index: 2; backdrop-filter: blur(8px); }

.workshop-media {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 24px 8px 24px 8px;
    background: var(--surface-2);
}

.media-fallback {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3rem;
    background:
        radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 38%),
        linear-gradient(135deg, var(--surface-2), var(--surface));
}

.card-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.card-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.4;
    letter-spacing: -0.02em;
}
.card-title a:hover { color: var(--accent); }

.card-excerpt { color: var(--muted); font-size: 0.93rem; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    margin-top: auto;
}

.card-date { color: var(--muted); font-size: 0.82rem; font-weight: 700; }

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.9rem;
}
.card-link svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.card-link:hover svg { transform: translateX(-4px); }

/* ================= الفلاتر ================= */
.filters { display: flex; flex-wrap: wrap; gap: 10px; }

.filter-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}
.filter-link:hover { color: var(--ink); border-color: var(--accent); }
.filter-link.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.filter-count {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 0.74rem;
}

/* ================= النماذج ================= */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 0.92rem;
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.96rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.form-control { min-height: 130px; resize: vertical; }

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-help { color: var(--muted); font-size: 0.84rem; margin-top: 6px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-2);
    cursor: pointer;
    font-weight: 700;
}
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--accent); }

.alert-box {
    padding: 15px 18px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-weight: 800;
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert-box svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; }
.alert-success { background: rgba(31,122,85,.10); color: #1f7a55; border-color: rgba(31,122,85,.2); }
.alert-error   { background: rgba(163,59,59,.10); color: #a33b3b; border-color: rgba(163,59,59,.2); }
.alert-info    { background: rgba(36,95,168,.10); color: #245fa8; border-color: rgba(36,95,168,.2); }
[data-theme="dark"] .alert-success { color: #65d3a8; }
[data-theme="dark"] .alert-error   { color: #ff8b8b; }
[data-theme="dark"] .alert-info    { color: #70aefc; }

/* ================= سلايدر الوسائط ================= */
.media-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 34px 10px 34px 10px;
    box-shadow: var(--shadow);
    padding: 12px;
}

.slider-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 24px 8px 24px 8px;
    background: #0e1013;
    touch-action: pan-y;
}

.slider-track {
    display: flex;
    transition: transform 0.38s cubic-bezier(.2,.7,.2,1);
    will-change: transform;
}

.slide {
    min-width: 100%;
    width: 100%;
    display: grid;
    place-items: center;
    min-height: 280px;
    max-height: 78vh;
}

.slide img, .slide video {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.slide iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 78vh;
    border: 0;
}
.slide iframe.tiktok-embed { width: min(100%, 420px); aspect-ratio: 9 / 16; }

.external-video-box { padding: 34px 22px; text-align: center; color: #fff; }
.external-video-box p { color: rgba(255,255,255,.72); margin-bottom: 14px; }

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(10,10,10,.58);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    z-index: 3;
}
.slider-btn:hover { background: var(--accent); border-color: var(--accent); }
.slider-btn svg { width: 20px; height: 20px; }
.slider-prev { right: 12px; }
.slider-next { left: 12px; }

.slider-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 8px 4px; }

.slider-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--line);
    cursor: pointer;
    transition: all 0.22s ease;
}
.slider-dot.active { width: 26px; border-radius: 999px; background: var(--accent); }

.slider-tabs { display: flex; justify-content: center; gap: 10px; padding: 8px 0 4px; flex-wrap: wrap; }

.slider-tab {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.slider-tab svg { width: 16px; height: 16px; }
.slider-tab:hover { color: var(--ink); border-color: var(--accent); }
.slider-tab.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ================= اللايت بوكس ================= */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 8, 0.9);
    z-index: 9000;
    padding: 20px;
    align-items: center;
    justify-content: center;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 95%; max-height: 88vh; border-radius: 18px; background: #fff; }
.lightbox-close {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

/* ================= حالة فارغة ================= */
.empty-state {
    text-align: center;
    padding: 70px 24px;
    border: 1px dashed var(--line);
    border-radius: 30px;
    background: var(--surface);
    color: var(--muted);
}
.empty-state h3 { font-family: var(--font-display); color: var(--ink); font-size: 1.35rem; margin-bottom: 8px; }

/* ================= الظهور عند التمرير ================= */
html.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(.2,.7,.2,1);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ================= الفوتر ================= */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 44px 0 24px;
    margin-top: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.9fr 0.9fr;
    gap: 28px;
    margin-bottom: 30px;
}

.footer-brand p { color: var(--muted); font-size: 0.94rem; margin-top: 14px; max-width: 340px; }

.footer-col h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 14px;
}

.footer-links { list-style: none; display: grid; gap: 10px; }
.footer-links a { color: var(--muted); font-size: 0.94rem; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-bottom-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom-links a:hover { color: var(--accent); }

/* ================= التجاوب ================= */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .site-nav { display: none; }
    .menu-toggle { display: grid; }
    .header-cta { display: none; }
    .section-head { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 24px, 100%); }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .workshops-grid { grid-template-columns: 1fr; }
    .panel-head, .panel-body { padding: 20px 16px; }
    .slide { min-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}