/* Saudi Classifications Directory 2026 */
:root {
    --green: #006847;
    --green-dark: #004d33;
    --green-light: #e8f5e9;
    --gold: #c8a951;
    --gold-light: #fef9e7;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-light: #475569;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Noto Sans Arabic', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
}

a { color: var(--green); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--green-dark); text-decoration: underline; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 10px 0;
    gap: 16px;
}
.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.site-logo:hover { text-decoration: none; color: white; opacity: 0.95; }
.site-logo .flag { font-size: 1.5rem; }
.site-logo .brand-name { font-weight: 800; }
.site-logo .brand-year {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.22);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.header-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 24px;
    padding: 6px 14px;
    max-width: 320px;
    flex: 1;
    gap: 8px;
    transition: all 0.2s;
}
.header-search:focus-within {
    background: rgba(255,255,255,0.28);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.2);
}
.header-search span { font-size: 0.9rem; opacity: 0.85; }
.header-search input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    font-size: 0.88rem;
    font-family: inherit;
}
.header-search input::placeholder { color: rgba(255,255,255,0.75); }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.site-nav a {
    color: rgba(255,255,255,0.92);
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}
.site-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
}
.site-nav a.lang-switch {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.4);
    margin-left: 6px;
}
[dir="rtl"] .site-nav a.lang-switch {
    margin-left: 0;
    margin-right: 6px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.9rem;
    color: var(--text-light);
}
.breadcrumbs a { color: var(--green); font-weight: 600; }
.breadcrumbs span { margin: 0 8px; color: #94a3b8; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--green) 0%, #00875a 50%, var(--green-dark) 100%);
    color: white;
    padding: 56px 0;
    margin-bottom: 36px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 6px 20px rgba(0,104,71,0.2);
}
.hero h1 { font-size: 2.4rem; margin-bottom: 14px; font-weight: 800; line-height: 1.25; }
.hero p { font-size: 1.15rem; opacity: 0.94; max-width: 820px; line-height: 1.65; }

/* Stats bar */
.stats-bar {
    display: flex;
    gap: 16px;
    margin: 28px 0 0;
    flex-wrap: wrap;
}
.stat-item {
    background: rgba(255,255,255,0.18);
    padding: 14px 22px;
    border-radius: 12px;
    text-align: center;
    min-width: 130px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
}
.stat-num { font-size: 1.8rem; font-weight: 800; display: block; line-height: 1.2; }
.stat-label { font-size: 0.82rem; opacity: 0.9; margin-top: 4px; display: block; font-weight: 500; }

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    border-color: #cbd5e1;
}
.card h3 { margin-bottom: 10px; font-size: 1.15rem; line-height: 1.4; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--green); text-decoration: none; }
.card h3 .code {
    display: inline-block;
    background: var(--green-light);
    color: var(--green);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 800;
    margin-right: 8px;
}
.card .desc {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 14px;
    line-height: 1.55;
}
.card .meta {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
    color: #64748b;
}
.card .badge {
    display: inline-block;
    background: #f1f5f9;
    color: #334155;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Single page */
.page-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 38px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 28px;
}
.page-card h1 {
    font-size: 1.85rem;
    color: var(--green-dark);
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--green-light);
    font-weight: 800;
    line-height: 1.3;
}
.page-card h2 {
    font-size: 1.35rem;
    color: var(--text);
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}
.page-card h3 {
    font-size: 1.15rem;
    margin: 22px 0 10px;
    color: var(--green-dark);
    font-weight: 700;
}
.page-card p { margin-bottom: 14px; font-size: 1.02rem; line-height: 1.75; }
.page-card ul, .page-card ol { margin: 14px 0 18px 28px; }
.page-card li { margin-bottom: 8px; line-height: 1.65; font-size: 1rem; }
.page-card code {
    background: var(--green-light);
    color: var(--green-dark);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.page-card hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.page-card strong { color: var(--text); font-weight: 700; }

/* E-E-A-T Source note block */
.source-note {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--green);
    border-radius: 8px;
    padding: 18px 22px;
    margin: 28px 0 12px;
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.6;
}
[dir="rtl"] .source-note {
    border-left: 1px solid #cbd5e1;
    border-right: 4px solid var(--green);
}
.source-note p { margin-bottom: 6px; font-size: 0.92rem; }
.source-note p:last-child { margin-bottom: 0; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
th, td {
    border: 1px solid var(--border);
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}
th {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--text);
}
tr:nth-child(even) td {
    background: #fafafa;
}
[dir="rtl"] th, [dir="rtl"] td {
    text-align: right;
}

/* Children list on single page */
.children-list { margin: 18px 0; }
.children-list a {
    display: block;
    padding: 14px 18px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
    color: var(--text);
    font-size: 0.98rem;
}
.children-list a:hover {
    background: var(--green-light);
    border-color: var(--green);
    text-decoration: none;
    transform: translateX(4px);
}
[dir="rtl"] .children-list a:hover {
    transform: translateX(-4px);
}

/* Search */
.search-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(0,104,71,0.15);
}

/* Footer */
.site-footer {
    margin-top: 70px;
    padding: 48px 0 32px;
    background: #0f172a;
    color: rgba(255,255,255,0.78);
    font-size: 0.9rem;
    border-top: 4px solid var(--green);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-col h4 {
    color: #50c878;
    font-size: 0.98rem;
    margin-bottom: 14px;
    font-weight: 700;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.15s;
}
.footer-col a:hover {
    color: #50c878;
    text-decoration: underline;
}
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 22px;
    text-align: center;
    font-size: 0.84rem;
    color: #94a3b8;
}
.footer-bottom a { color: var(--gold); }
.footer-sub { font-size: 0.8rem; color: #64748b !important; margin-top: 4px; }

/* RTL Support */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] body { direction: rtl; text-align: right; }
[dir="rtl"] .page-card ul, [dir="rtl"] .page-card ol { margin-left: 0; margin-right: 28px; }
[dir="rtl"] .card h3 .code { margin-right: 0; margin-left: 8px; }

/* Responsive */
@media (max-width: 768px) {
    .hero { padding: 40px 0; }
    .hero h1 { font-size: 1.8rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; height: auto; padding: 14px 0; gap: 14px; }
    .site-nav { flex-wrap: wrap; justify-content: center; gap: 6px; }
    .stats-bar { justify-content: center; }
    .page-card { padding: 22px; }
}
