/* ==================== VARIABLES ==================== */
:root {
    --bg-primary: #0a0a1f;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(15, 15, 42, 0.7);
    --accent: #038387;
    --accent-light: #05b5ba;
    --accent-glow: rgba(3, 131, 135, 0.25);
    --green-wa: #25D366;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #7a7a9e;
    --border: rgba(255, 255, 255, 0.08);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.3s ease;
    --font-en: 'Inter', system-ui, sans-serif;
    --font-ar: 'Cairo', 'Inter', system-ui, sans-serif;
}

/* ==================== RESET ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-en);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { font-family: var(--font-ar); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}
ul { list-style: none; }

/* ==================== GALAXY CANVAS ==================== */
#galaxyCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== SPLASH ==================== */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s, visibility 0.6s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; }
.splash-logo-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
}
.splash-logo-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    animation: spin 1.2s linear infinite;
}
.splash-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}
.splash-brand {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}
.splash-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.splash-loader {
    width: 160px;
    height: 3px;
    background: var(--border);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}
.splash-loader-bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    animation: loader 1.4s ease infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loader {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ==================== APP ==================== */
.app { position: relative; z-index: 1; min-height: 100vh; }
.app.hidden { display: none; }

/* ==================== TOPBAR ==================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(10, 10, 31, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}
.topbar-nav {
    display: flex;
    gap: 1.5rem;
}
.topbar-nav a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.topbar-nav a:hover { color: var(--accent-light); }
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ==================== HERO ==================== */
.hero {
    text-align: center;
    padding: 5rem 0 3rem;
    animation: fadeUp 0.8s ease;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-xl);
    background: var(--accent-glow);
    border: 1px solid rgba(3, 131, 135, 0.3);
    color: var(--accent-light);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}
.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 30%, var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}
.hero-stats {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.stat {
    text-align: center;
}
.stat strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-light);
}
.stat span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--green-wa), #128C7E);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
}
.btn-outline {
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-glow);
}
.full-w { width: 100%; justify-content: center; }

/* ==================== SECTIONS ==================== */
.section {
    padding: 4rem 0;
}
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}
.section-label {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ==================== SERVICES GRID ==================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    border-color: rgba(3, 131, 135, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(3, 131, 135, 0.1);
}
.service-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-glow);
    color: var(--accent-light);
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}
.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.service-card > p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}
.service-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex: 1;
}
.service-features li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.service-features li i {
    font-size: 0.75rem;
    color: var(--accent-light);
    flex-shrink: 0;
}
.btn-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-xl);
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.25);
    color: var(--green-wa);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    justify-content: center;
}
.btn-card:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: var(--green-wa);
    transform: translateY(-1px);
}

/* ==================== CONTACT ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
}
.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.contact-card.wa {
    border-color: rgba(37, 211, 102, 0.3);
    background: rgba(37, 211, 102, 0.06);
}
.contact-card.wa:hover {
    border-color: var(--green-wa);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.15);
}
.contact-card i {
    font-size: 1.8rem;
    color: var(--accent-light);
}
.contact-card.wa i { color: var(--green-wa); }
.contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
}
.contact-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== FORM ==================== */
.form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
}
.form-wrapper h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.form-wrapper > p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.92rem;
    transition: border-color var(--transition);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--accent); }
select.form-input { cursor: pointer; }
select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ==================== FOOTER ==================== */
.footer {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}
.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}
.footer-top p {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-socials {
    display: flex;
    gap: 1rem;
}
.footer-socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.footer-socials a:hover {
    background: var(--accent-glow);
    color: var(--accent-light);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== RTL OVERRIDES ==================== */
[dir="rtl"] .topbar-nav { direction: rtl; }
[dir="rtl"] .service-features li { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .service-features li i { order: 1; }
[dir="rtl"] .hero-badge i { order: 1; }
[dir="rtl"] .btn i { order: 1; }
[dir="rtl"] .btn-card i { order: 1; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .topbar-nav { display: none; }
    .hero { padding: 3rem 0 2rem; }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-stats { gap: 1.5rem; }
    .services-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-wrapper { padding: 1.5rem; }
    .footer-top { flex-direction: column; text-align: center; gap: 0.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .hero-cta { flex-direction: column; align-items: center; }
    .contact-grid { grid-template-columns: 1fr; }
    .stat strong { font-size: 1.3rem; }
}
