/* ============================================================
   Olspark — Corporate Website
   Brand: blue #0066FF, gold #FFB800. Dark-first, with light mode.
   ============================================================ */

:root {
    /* Brand identity: white / black / red. Red is the single accent;
       both former accent vars map to red so existing usages restyle cleanly. */
    --ols-red: #D81E20;
    --ols-red-600: #b3171b;
    --ols-blue: #D81E20;
    --ols-blue-600: #b3171b;
    --ols-gold: #D81E20;
    --ols-gold-600: #b3171b;
    --radius: 16px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, .25);
    --transition: .3s cubic-bezier(.4, 0, .2, 1);
}

/* Dark theme (default) */
[data-bs-theme="dark"] {
    --bg: #0a0e1a;
    --bg-elev: #111827;
    --bg-card: #131a2b;
    --border: rgba(255, 255, 255, .08);
    --text: #e8edf5;
    --text-soft: #9aa7bd;
    --hero-glow: radial-gradient(circle at 20% 20%, rgba(216,30,32,.20), transparent 45%),
                 radial-gradient(circle at 80% 30%, rgba(216,30,32,.10), transparent 48%);
}

/* Light theme */
[data-bs-theme="light"] {
    --bg: #f6f8fc;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --border: rgba(10, 14, 26, .08);
    --text: #0e1726;
    --text-soft: #5b677d;
    --hero-glow: radial-gradient(circle at 20% 20%, rgba(216,30,32,.10), transparent 45%),
                 radial-gradient(circle at 80% 30%, rgba(0,0,0,.06), transparent 45%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Cairo', sans-serif;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

[dir="rtl"] body { font-family: 'Cairo', 'Inter', sans-serif; }

h1, h2, h3, h4, h5, h6 { font-weight: 800; letter-spacing: -.02em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }

a { text-decoration: none; }

.text-gold { color: var(--ols-gold) !important; }
.text-blue { color: var(--ols-blue) !important; }
.text-muted-soft { color: var(--text-soft); }
.text-gradient {
    background: linear-gradient(120deg, var(--ols-red), #000);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

section { position: relative; }
.section-pad { padding: 96px 0; }
.section-label {
    display: inline-block;
    font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ols-gold); margin-bottom: 12px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-subtitle { color: var(--text-soft); font-size: 1.08rem; max-width: 640px; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .65rem 1.4rem; transition: var(--transition); }
.btn-gold { background: var(--ols-red); color: #fff; border: none; }
.btn-gold:hover { background: var(--ols-red-600); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(216,30,32,.4); }
.btn-blue { background: var(--ols-red); color: #fff; border: none; }
.btn-blue:hover { background: var(--ols-red-600); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(216,30,32,.4); }
.btn-outline-soft { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn-outline-soft:hover { border-color: var(--ols-blue); color: var(--ols-blue); }
.btn-icon {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text);
    padding: 0 .6rem; width: auto; min-width: 40px;
}
.btn-icon:hover { border-color: var(--ols-blue); color: var(--ols-blue); }
.lang-label { font-size: .8rem; font-weight: 700; }

/* ---------- Navbar ---------- */
.ols-navbar {
    background: transparent;
    backdrop-filter: blur(0);
    padding: 18px 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}
.ols-navbar.scrolled {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(14px);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.ols-logo-mark {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ols-red); border-radius: 11px; color: #fff; font-size: 1.1rem;
}
.ols-logo-text { font-weight: 900; font-size: 1.35rem; color: var(--text); }
/* Company logo image — swap variant by theme */
.ols-logo { height: 38px; width: auto; display: block; }
.ols-logo.logo-dark { display: none; }
[data-bs-theme="dark"] .ols-logo.logo-light { display: none; }
[data-bs-theme="dark"] .ols-logo.logo-dark { display: block; }
.ols-footer .ols-logo, .login-card .ols-logo { height: 44px; }
.ols-navbar .nav-link { color: var(--text-soft); font-weight: 600; padding: .5rem .9rem; border-radius: 8px; }
.ols-navbar .nav-link:hover, .ols-navbar .nav-link.active { color: var(--text); }
.ols-navbar .nav-link.active { color: var(--ols-gold); }
.navbar-toggler { border: none; color: var(--text); font-size: 1.5rem; }
.navbar-toggler:focus { box-shadow: none; }

/* theme icons */
.theme-icon-light { display: none; }
[data-bs-theme="light"] .theme-icon-dark { display: none; }
[data-bs-theme="light"] .theme-icon-light { display: inline; }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    padding-top: 120px; padding-bottom: 60px; position: relative; overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 0; background: var(--hero-glow); z-index: 0;
}
.hero-grid-bg {
    position: absolute; inset: 0; z-index: 0; opacity: .4;
    background-image: linear-gradient(var(--border) 1px, transparent 1px),
                      linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: 999px; font-size: .85rem; color: var(--text-soft); margin-bottom: 22px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #21d07a; box-shadow: 0 0 0 4px rgba(33,208,122,.2); }
.hero-title { font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.12; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.2rem; color: var(--text-soft); max-width: 620px; margin-bottom: 32px; }

/* ---------- Cards ---------- */
.ols-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; height: 100%; transition: var(--transition); position: relative; overflow: hidden;
}
.ols-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--ols-blue) 50%, transparent); box-shadow: var(--shadow-soft); }
.ols-card .card-icon {
    width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.6rem; margin-bottom: 18px;
    background: color-mix(in srgb, var(--ols-blue) 14%, transparent); color: var(--ols-blue);
}
.ols-card.gold .card-icon { background: color-mix(in srgb, var(--ols-gold) 16%, transparent); color: var(--ols-gold); }
.ols-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.ols-card p { color: var(--text-soft); margin-bottom: 0; }
.card-link { color: var(--ols-blue); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; }
[dir="rtl"] .card-link .bi-arrow-right::before { content: "\f12f"; } /* arrow-left */

/* ---------- Stats ---------- */
.stats-strip { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-item { text-align: center; padding: 28px 10px; }
.stat-value { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; color: var(--ols-gold); line-height: 1; }
.stat-label { color: var(--text-soft); margin-top: 8px; font-weight: 600; }
.stat-icon { font-size: 1.4rem; color: var(--ols-blue); margin-bottom: 10px; display: block; }

/* ---------- Globe ---------- */
#globeViz { width: 100%; height: 480px; cursor: grab; }
#globeViz:active { cursor: grabbing; }
.globe-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.country-list .country-chip {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
    border: 1px solid var(--border); margin-bottom: 10px; cursor: pointer; transition: var(--transition); background: var(--bg-card);
}
.country-chip:hover, .country-chip.active { border-color: var(--ols-gold); transform: translateX(0); }
[dir="ltr"] .country-chip:hover { transform: translateX(4px); }
[dir="rtl"] .country-chip:hover { transform: translateX(-4px); }
.country-flag { font-size: 1.4rem; }

/* ---------- Projects ---------- */
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 100%; transition: var(--transition); }
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.project-thumb { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #fff; position: relative; }
.project-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.35)); }
.project-body { padding: 22px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ols-blue) 14%, transparent); color: var(--ols-blue); margin: 2px; }

/* ---------- Logo wall (infinite scroll) ---------- */
.logo-wall { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.logo-track { display: flex; gap: 60px; width: max-content; animation: scroll-x 28s linear infinite; }
.logo-track .logo-item { font-size: 1.4rem; font-weight: 800; color: var(--text-soft); opacity: .7; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
[dir="rtl"] .logo-track { animation-direction: reverse; }

/* ---------- Testimonials ---------- */
.testimonial-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; height: 100%; }
.testimonial-card .quote-mark { font-size: 2.5rem; color: var(--ols-gold); line-height: 1; }
.testimonial-card p { color: var(--text); font-size: 1.05rem; }
.testimonial-author { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.author-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--ols-red), #111); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }

/* ---------- CTA block ---------- */
.cta-block { background: linear-gradient(120deg, var(--ols-red), #111); border-radius: 24px; padding: 60px; text-align: center; position: relative; overflow: hidden; }
.cta-block h2 { color: #fff; }
.cta-block p { color: rgba(255,255,255,.85); }
.cta-block::before { content: ""; position: absolute; top: -40%; inset-inline-end: -10%; width: 380px; height: 380px; background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }

/* ---------- Trust bar ---------- */
.trust-item { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-soft); font-weight: 600; padding: 18px; }
.trust-item i { font-size: 1.6rem; color: var(--ols-blue); }

/* ---------- Page header ---------- */
.page-header { padding: 150px 0 60px; background: var(--hero-glow), var(--bg-elev); border-bottom: 1px solid var(--border); text-align: center; }
.page-header h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-header p { color: var(--text-soft); max-width: 620px; margin: 14px auto 0; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-inline-start: 30px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 6px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: -30px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--ols-gold); border: 3px solid var(--bg); }
.timeline-year { color: var(--ols-blue); font-weight: 800; }

/* ---------- Forms ---------- */
.form-control, .form-select { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: .75rem 1rem; border-radius: 10px; }
.form-control:focus, .form-select:focus { background: var(--bg-card); color: var(--text); border-color: var(--ols-blue); box-shadow: 0 0 0 .2rem rgba(0,102,255,.18); }
.form-control::placeholder { color: var(--text-soft); }
.form-label { font-weight: 600; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.ols-footer { background: var(--bg-elev); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-heading { font-weight: 700; margin-bottom: 16px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--text-soft); transition: var(--transition); }
.footer-links a:hover { color: var(--ols-gold); }
.footer-bottom { border-top: 1px solid var(--border); }
.social-link { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-soft); transition: var(--transition); }
.social-link:hover { background: var(--ols-blue); color: #fff; border-color: var(--ols-blue); }

/* ---------- Floating widgets ---------- */
.floating-whatsapp {
    position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 1040;
    width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
    box-shadow: 0 8px 24px rgba(37,211,102,.45); transition: var(--transition); animation: pulse-wa 2.5s infinite;
}
.floating-whatsapp:hover { color: #fff; transform: scale(1.08); }
@keyframes pulse-wa { 0%,100% { box-shadow: 0 8px 24px rgba(37,211,102,.45); } 50% { box-shadow: 0 8px 30px rgba(37,211,102,.7); } }

.back-to-top {
    position: fixed; bottom: 156px; inset-inline-end: 26px; z-index: 1040;
    width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); display: none; align-items: center; justify-content: center; transition: var(--transition);
}
.back-to-top.show { display: flex; }
.back-to-top:hover { background: var(--ols-blue); color: #fff; }

.sticky-cta {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 1035;
    background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 12px 0; transform: translateY(120%); transition: var(--transition);
}
.sticky-cta.show { transform: translateY(0); }
.sticky-cta-text { font-weight: 600; }
.btn-close-sticky { background: transparent; border: none; color: var(--text-soft); font-size: 1rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- AI Chatbot ---------- */
.chatbot-fab {
    position: fixed; bottom: 90px; inset-inline-end: 24px; z-index: 1041;
    width: 56px; height: 56px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--ols-red), #111); color: #fff; font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(216,30,32,.4); transition: var(--transition);
}
.chatbot-fab:hover { transform: scale(1.08); }
.chatbot-panel {
    position: fixed; bottom: 90px; inset-inline-end: 24px; z-index: 1042;
    width: 370px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
    display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-soft);
    opacity: 0; transform: translateY(20px) scale(.96); pointer-events: none; transition: var(--transition);
}
.chatbot-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.chatbot-head { background: linear-gradient(135deg, var(--ols-red), #111); color: #fff; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.chatbot-avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.btn-close-chat { background: transparent; border: none; color: #fff; font-size: 1.1rem; }
.chatbot-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.5; }
.chat-msg.bot { background: var(--bg-elev); border: 1px solid var(--border); align-self: flex-start; border-start-start-radius: 4px; }
.chat-msg.user { background: var(--ols-blue); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }
.chat-msg.typing { letter-spacing: 3px; opacity: .6; }
.chatbot-suggest { padding: 0 16px 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-suggest-label { width: 100%; font-size: .78rem; color: var(--text-soft); margin-bottom: 2px; }
.chat-chip { font-size: .78rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); transition: var(--transition); }
.chat-chip:hover { border-color: var(--ols-blue); color: var(--ols-blue); }
.chatbot-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.chatbot-input input { flex: 1; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: .55rem .9rem; }
.chatbot-input input:focus { outline: none; border-color: var(--ols-blue); }
.chatbot-input button { width: 42px; border: none; border-radius: 10px; background: var(--ols-blue); color: #fff; }

/* ---------- Cost Calculator ---------- */
.calc-option { cursor: pointer; margin: 0; }
.calc-option-box { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); transition: var(--transition); height: 100%; }
.calc-option:hover .calc-option-box { border-color: var(--ols-blue); }
.calc-option.selected .calc-option-box { border-color: var(--ols-gold); background: color-mix(in srgb, var(--ols-gold) 10%, transparent); }
.calc-check { opacity: 0; color: var(--ols-gold); transition: var(--transition); }
.calc-option.selected .calc-check { opacity: 1; }
.sticky-lg { position: sticky; }
@media (max-width: 991px) { .sticky-lg { position: static; } }

/* ---------- Visitor pill ---------- */
.visitor-pill {
    position: fixed; bottom: 24px; inset-inline-start: 24px; z-index: 1039;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
    padding: 10px 16px; font-size: .85rem; box-shadow: var(--shadow-soft);
    display: flex; align-items: center; gap: 8px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: var(--transition);
}
.visitor-pill.show { transform: none; opacity: 1; }
.visitor-dot { width: 9px; height: 9px; border-radius: 50%; background: #21d07a; box-shadow: 0 0 0 4px rgba(33,208,122,.2); animation: pulse-wa 2s infinite; }

/* ---------- Exit popup ---------- */
.exit-overlay {
    position: fixed; inset: 0; z-index: 1060; background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: var(--transition);
}
.exit-overlay.open { opacity: 1; pointer-events: auto; }
.exit-modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 40px 32px;
    max-width: 440px; width: 100%; text-align: center; position: relative; transform: scale(.92); transition: var(--transition);
}
.exit-overlay.open .exit-modal { transform: scale(1); }
.exit-close { position: absolute; top: 14px; inset-inline-end: 14px; background: transparent; border: none; color: var(--text-soft); font-size: 1.1rem; }
.exit-icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: color-mix(in srgb, var(--ols-gold) 16%, transparent); color: var(--ols-gold); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .ols-navbar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
    .navbar-collapse { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-top: 12px; }
    .cta-block { padding: 36px 22px; }
    .section-pad { padding: 64px 0; }
}
