/* ================================================
   OPCAai — Common Styles
   Shared across all pages: reset, variables, nav,
   footer, buttons, section headers, utilities, RTL
   ================================================ */

/* --- Critical Preload Styles --- */
html {
    background-color: #06080f;
    min-height: 100vh;
}

body {
    background-color: #06080f;
    color: #f0f2ff;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #06080f;
    --bg-secondary: #0c1021;
    --bg-card: #111631;
    --bg-card-hover: #161c3a;
    --bg-glass: rgba(17, 22, 49, 0.7);

    --text-primary: #f0f2ff;
    --text-secondary: #8b92b3;
    --text-muted: #5a6183;

    --accent-blue: #00d4ff;
    --accent-purple: #7b61ff;
    --accent-pink: #ff3d7f;
    --accent-green: #00e5a0;
    --gradient-main: linear-gradient(135deg, #00d4ff 0%, #7b61ff 100%);
    --gradient-warm: linear-gradient(135deg, #ff6b6b 0%, #ff3d7f 100%);
    --gradient-cool: linear-gradient(135deg, #00e5a0 0%, #00b4d8 100%);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(0, 212, 255, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow-blue: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-glow-purple: 0 0 40px rgba(123, 97, 255, 0.15);

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-ar: 'Noto Sans Arabic', sans-serif;
    --font-cn: 'Noto Sans SC', sans-serif;

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-primary);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Language-specific fonts */
html[lang="ar"] body { font-family: var(--font-ar); }
html[lang="ar"] .font-display { font-family: var(--font-ar); }
html[lang="cn"] body { font-family: var(--font-cn); }
html[lang="cn"] .font-display { font-family: var(--font-cn); }

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

.section-padding {
    padding: 100px 0;
}

a {
    color: inherit;
    text-decoration: none !important;
    transition: color var(--transition-fast);
}

a:hover,
a:active,
a:visited,
a:focus {
    text-decoration: none !important;
}

img { max-width: 100%; }

/* --- Gradient Text --- */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 64px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-main);
    color: #f0f2ff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before { left: 100%; }

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.35);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glow);
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none !important;
}

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1rem;
}

/* ==========================
   NAVIGATION
   ========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--transition-smooth);
    background: rgba(6, 8, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar.scrolled {
    background: rgba(6, 8, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 0;
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text .logo-dot { color: var(--accent-blue); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active { color: var(--accent-blue); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-cta {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ==========================
   FOOTER
   ========================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .nav-logo { margin-bottom: 16px; }

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-col h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 5px 0;
    transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--accent-blue); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
}

.footer-bottom-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-bottom-links a:hover { color: var(--accent-blue); }

/* ==========================
   CTA SECTION (shared)
   ========================== */
.cta {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.06), transparent 70%);
    pointer-events: none;
}

.cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.cta-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cta-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cta-contact a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.cta-contact a:hover {
    color: var(--accent-blue-light);
}

/* ==========================
   FADE-IN ANIMATIONS
   ========================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================
   RESPONSIVE (shared)
   ========================== */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(6, 8, 15, 0.95);
        backdrop-filter: blur(20px);
        padding: 20px;
        border-bottom: 1px solid var(--border-subtle);
    }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .cta-content h2 { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .section-padding { padding: 64px 0; }
    .section-title { font-size: 2rem; }
    .nav-cta { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .cta-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .section-title { font-size: 1.6rem; }
}
