/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: rgb(170, 46, 53);
    --accent-hover: rgb(140, 36, 43);
    --accent-light: rgba(170, 46, 53, 0.15);
    --border: #262626;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, 
        var(--text-primary) 0%, 
        var(--text-primary) 40%, 
        var(--accent) 50%, 
        var(--text-primary) 60%, 
        var(--text-primary) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-cta {
    background: var(--accent);
    color: white;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-cta:hover {
    background: var(--accent-hover);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 6rem;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(170, 46, 53, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    background: linear-gradient(135deg, rgb(170, 46, 53), rgb(220, 80, 80));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

/* ===== SERVICES SECTION ===== */
.services {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.service-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(170, 46, 53, 0.2), rgba(220, 80, 80, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== TECHNOLOGIES SECTION ===== */
.tech {
    padding: 6rem 2rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.tech-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.tech-item:hover {
    border-color: var(--text-secondary);
}

.tech-item span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.tech-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== PROCESS SECTION ===== */
.process {
    padding: 6rem 2rem;
    background: var(--bg-secondary);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.process-step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgb(170, 46, 53), rgb(200, 70, 70));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.process-step h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.process-step p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== CTA SECTION ===== */
.cta {
    padding: 6rem 2rem;
    text-align: left;
    background: var(--bg-secondary);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
}

.contact-info h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.contact-form {
    background: var(--bg-card);
    padding: 48px;
    border-radius: 24px;
    border: 1px solid var(--border);
    position: relative;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.form-group input.error,
.form-group textarea.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    display: none;
    font-size: 13px;
    color: #ef4444;
    margin-top: 6px;
}

.form-error.active {
    display: block;
}

.form-submit {
    width: 100%;
    background: var(--accent);
    color: white;
    padding: 16px 32px;
    border-radius: 100px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.form-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-loader {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(22, 22, 22, 0.9);
    border-radius: 24px;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
}

.success-overlay.active {
    display: block;
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 48px;
    border-radius: 24px;
    text-align: center;
    z-index: 2001;
    max-width: 400px;
    width: 90%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-message.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

.success-message h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.success-message p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.success-button {
    background: var(--accent);
    color: white;
    padding: 14px 32px;
    border-radius: 100px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.success-button:hover {
    background: var(--accent-hover);
}

/* ===== FOOTER ===== */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1003;
}

.mobile-menu-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu {
    position: fixed;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    padding: 32px;
    transition: 0.3s ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* English: menu slides from right */
html:not([lang="ar"]) .mobile-menu {
    right: -100%;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
}

html:not([lang="ar"]) .mobile-menu.active {
    right: 0;
}

/* Arabic: menu slides from left (RTL) */
html[lang="ar"] .mobile-menu {
    left: -100%;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
}

html[lang="ar"] .mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-menu-links a {
    color: var(--bg-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    display: block;
}

.mobile-menu-cta {
    margin-top: 32px;
    display: block;
    text-align: center;
    background: var(--accent);
    color: white;
    padding: 16px 32px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
}

.lang-switch {
    color: var(--accent) !important;
    font-weight: 600 !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeUp 0.8s ease-out;
}

.service-card, .tech-item, .process-step {
    animation: fadeUp 0.6s ease-out backwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links, .nav-cta {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 7rem 1.5rem 4rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .services, .tech, .process, .cta {
        padding: 4rem 1.5rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-form {
        padding: 32px 24px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* ===== ARABIC RTL SUPPORT ===== */
html[lang="ar"] {
    direction: rtl;
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', -apple-system, sans-serif;
}

html[lang="ar"] .hero h1 {
    letter-spacing: 0;
}

html[lang="ar"] .section-label {
    letter-spacing: 0.05em;
}

html[lang="ar"] .logo {
    letter-spacing: 0;
}

html[lang="ar"] .contact-info {
    text-align: right;
}

html[lang="ar"] .cta {
    text-align: right;
}

html[lang="ar"] .form-group label {
    text-align: right;
}

html[lang="ar"] .form-group input,
html[lang="ar"] .form-group textarea {
    text-align: right;
    direction: rtl;
}

html[lang="ar"] .form-group input[type="tel"] {
    text-align: left;
    direction: ltr;
}

html[lang="ar"] .form-error {
    text-align: right;
}

html[lang="ar"] .success-message {
    direction: rtl;
}

html[lang="ar"] .success-message h3,
html[lang="ar"] .success-message p {
    text-align: center;
}
