/* ===== CSS Variables ===== */
:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #f8fafc;

    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.3);

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --transition: all 0.3s ease;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Amiri', serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

html[dir="rtl"] body {
    font-family: var(--font-arabic), var(--font-sans);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--text-light);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-nav {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.navbar.scrolled .nav-links a {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem;
    border-radius: var(--radius-full);
}

.navbar.scrolled .lang-switcher {
    background: var(--bg-light);
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.navbar.scrolled .lang-btn {
    color: var(--text-secondary);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--primary);
    color: var(--text-light);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: var(--transition);
}

.navbar.scrolled .mobile-menu-btn span {
    background: var(--text-primary);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(14, 165, 233, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    color: var(--text-light);
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.hero-cta .btn-outline {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.hero-cta .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-light);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Hero Visual / App Preview */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.app-preview {
    position: relative;
}

.preview-frame {
    width: 400px;
    background: var(--bg-darker);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotateY(-5deg) rotateX(5deg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: rotateY(-5deg) rotateX(5deg) translateY(0);
    }

    50% {
        transform: rotateY(-5deg) rotateX(5deg) translateY(-10px);
    }
}

.preview-header {
    display: flex;
    gap: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red {
    background: #f87171;
}

.dot.yellow {
    background: #fbbf24;
}

.dot.green {
    background: #34d399;
}

.preview-content {
    display: flex;
    height: 280px;
}

.preview-sidebar {
    width: 60px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-item {
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.sidebar-item.active {
    background: var(--primary);
}

.preview-main {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-card {
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.preview-card.small {
    height: 50px;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    animation: floatCard 4s ease-in-out infinite;
}

.card-icon {
    font-size: 1.25rem;
}

.floating-card.card-1 {
    top: 20%;
    left: -40px;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 50%;
    right: -30px;
    animation-delay: 1s;
}

.floating-card.card-3 {
    bottom: 15%;
    left: 0;
    animation-delay: 2s;
}

@keyframes floatCard {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Hero Wave */
.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ===== Features Section ===== */
.features {
    padding: 6rem 0;
    background: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-badge.light {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-title.light {
    color: var(--text-light);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-subtitle.light {
    color: var(--text-muted);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    color: var(--text-light);
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Pricing Section ===== */
.pricing {
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
}

.pricing-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.pricing .container {
    position: relative;
    z-index: 1;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured {
    background: linear-gradient(180deg, var(--bg-white) 0%, #f0f9ff 100%);
    border: 2px solid var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1.25rem;
    background: var(--gradient-primary);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
}

.pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.plan-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.pricing-price {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pricing-price .currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    vertical-align: top;
}

.pricing-price .amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.pricing-price .period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
    flex: 1;
}

.pricing-features li {
    padding: 0.625rem 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* ===== Newsletter Section ===== */
.newsletter {
    padding: 6rem 0;
    background: var(--bg-light);
}

.newsletter-card {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 4rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.newsletter-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.newsletter-content>p {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    background: var(--bg-light);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
}

.form-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.newsletter-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.visual-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.visual-dots {
    display: flex;
    gap: 8px;
}

.visual-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 1.5s ease-in-out infinite;
}

.visual-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.visual-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    padding: 4rem 0 2rem;
    color: var(--text-light);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.footer-col a {
    display: block;
    padding: 0.375rem 0;
    color: var(--text-light);
    font-size: 0.9375rem;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--success);
    color: var(--text-light);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-icon {
    font-size: 1.25rem;
}

/* ===== RTL Support ===== */
html[dir="rtl"] .hero-container {
    direction: rtl;
}

html[dir="rtl"] .nav-links {
    direction: rtl;
}

html[dir="rtl"] .hero-cta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .floating-card.card-1 {
    left: auto;
    right: -40px;
}

html[dir="rtl"] .floating-card.card-2 {
    right: auto;
    left: -30px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
        display: none;
    }

    .hero-subtitle {
        max-width: 100%;
        margin: 0 auto 2rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-card.featured {
        transform: none;
    }

    .pricing-card.featured:hover {
        transform: translateY(-5px);
    }

    .newsletter-card {
        grid-template-columns: 1fr;
    }

    .newsletter-visual {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .btn-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .newsletter-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }
}