/* Hamad Platform Core — Public CSS */
:root {
    --primary: #1a73e8;
    --secondary: #34a853;
    --bg: #f5f7fa;
    --white: #fff;
    --border: #e2e8f0;
    --text: #1a1a1a;
    --text-muted: #718096;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
body.rtl { direction: rtl; }
body.ltr { direction: ltr; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── News Ticker ── */
.news-ticker {
    background: var(--primary); color: #fff; overflow: hidden; height: 36px;
    display: flex; align-items: center; font-size: 13px;
}
.news-ticker-inner {
    display: flex; align-items: center; gap: 0;
    animation: ticker-scroll 30s linear infinite; white-space: nowrap; padding-inline-start: 100%;
}
.news-ticker-inner:hover { animation-play-state: paused; }
.news-item { padding: 0 24px; color: #fff; text-decoration: none; }
.news-item:hover { text-decoration: underline; }
.news-logo-sep { height: 20px; margin: 0 16px; border-radius: 3px; }
.news-logo-text-sep { display: inline-block; width: 24px; height: 24px; background: rgba(255,255,255,.2); border-radius: 50%; text-align: center; line-height: 24px; margin: 0 16px; }

@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
body.ltr .news-ticker-inner { animation-name: ticker-scroll-ltr; }
@keyframes ticker-scroll-ltr { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ── Header ── */
.site-header {
    background: var(--white); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); height: var(--header-h);
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; gap: 20px; height: 100%;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 40px; }
.logo-text-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; flex-shrink: 0;
}
.logo-name { font-size: 17px; font-weight: 700; color: var(--text); }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: 6px; color: var(--text); font-size: 14px; transition: background .15s; }
.nav-link:hover { background: var(--bg); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.lang-switch { display: flex; gap: 4px; }
.lang-btn { padding: 4px 8px; border-radius: 4px; font-size: 12px; color: var(--text-muted); background: var(--bg); text-decoration: none; transition: all .15s; }
.lang-btn.active, .lang-btn:hover { background: var(--primary); color: #fff; }
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.user-avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.user-dropdown {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 8px; min-width: 160px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown a { display: block; padding: 8px 10px; color: var(--text); border-radius: 6px; font-size: 14px; }
.user-dropdown a:hover { background: var(--bg); text-decoration: none; }
.mobile-nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }

/* ── Ads ── */
.ad-block { overflow: hidden; }
.ad-top { border-bottom: 1px solid var(--border); }
.ad-bottom { border-top: 1px solid var(--border); }
.layout-with-ads { display: flex; max-width: 1200px; margin: 0 auto; padding: 20px; gap: 20px; }
.ad-sidebar { width: 200px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; }

/* ── Content ── */
.home-cta { text-align: center; padding: 60px 20px; }
.home-cta h2 { font-size: 28px; margin-bottom: 10px; }
.home-cta p { color: var(--text-muted); margin-bottom: 24px; }
.home-message { background: var(--white); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; }
.home-welcome { padding: 20px 0; }
.page-content { padding: 24px 0; max-width: 800px; }
.page-content h1 { font-size: 28px; margin-bottom: 20px; }
.rich-content img { border-radius: 8px; max-width: 100%; }
.rich-content h1,.rich-content h2,.rich-content h3 { margin: 1em 0 .5em; }
.rich-content p { margin-bottom: 1em; }
.rich-content ul,.rich-content ol { margin: 1em 0 1em 1.5em; }
.page-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-block { min-width: 0; }

/* ── Login Box ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
    background: var(--white); border-radius: 16px; padding: 36px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12); text-align: center; margin: 20px;
}
.login-box h2 { font-size: 22px; margin-bottom: 6px; }
.login-box p { color: var(--text-muted); margin-bottom: 24px; }
.btn-google-public {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 13px 20px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--white); font-size: 15px; font-weight: 500; color: var(--text);
    text-decoration: none; transition: box-shadow .15s; margin-bottom: 16px;
}
.btn-google-public:hover { box-shadow: 0 4px 12px rgba(0,0,0,.15); text-decoration: none; }

/* ── Profile Form ── */
.form-box {
    background: var(--white); border-radius: 12px; padding: 32px; max-width: 600px;
    margin: 40px auto; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.form-box h2 { margin-bottom: 8px; font-size: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; font-family: inherit; transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all .15s; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: .9; text-decoration: none; }
.btn-danger { background: #ea4335; color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ── Policies ── */
.policy-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.policy-card h3 { font-size: 16px; margin-bottom: 12px; }
.policy-content { max-height: 300px; overflow-y: auto; font-size: 14px; line-height: 1.7; padding: 12px; background: #f8f9fa; border-radius: 6px; }
.policy-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); background: var(--white); padding: 20px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; gap: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-nav { display: none; position: fixed; top: var(--header-h); inset-inline-start: 0; right: 0; background: var(--white); flex-direction: column; padding: 16px; border-top: 1px solid var(--border); box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .mobile-nav-toggle { display: block; }
    .ad-sidebar { display: none; }
    .layout-with-ads { flex-direction: column; padding: 12px; }
    .form-row { flex-direction: column; }
    .logo-name { font-size: 15px; }
}
