@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&family=Outfit:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --accent: #f59e0b;
    --bg-dark: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(15, 23, 42, 0.8);
    --border-glass: rgba(255, 255, 255, 0.1);
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

/* Background Mesh Gradient */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 1) 100%);
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
}

/* Navbar */
nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased gap */
}

.logo img {
    height: 42px; /* Slightly adjusted size */
    width: 42px;
}

.logo-text {
    font-family: var(--font-en);
    font-size: 1.35rem; /* Slightly smaller for better balance */
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-ar);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
    white-space: nowrap; /* Prevent text wrapping */
    text-align: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 80px;
}

.hero-container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1.2;
    text-align: right;
}

.hero-visual {
    flex: 1;
    position: relative;
}

.hero-visual img {
    width: 100%;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border-glass);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 24px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 40px;
}

/* Slider Section */
.slider-container {
    max-width: 1000px;
    margin: 60px auto;
    position: relative;
    padding: 20px;
}

.slide {
    display: none;
    animation: fadeIn 0.8s ease-out forwards;
}

.slide.active {
    display: block;
}

.slide-content {
    background: var(--bg-card);
    padding: 0;
    border-radius: 32px;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 450px;
}

.slide-image {
    flex: 1;
    height: 100%;
    min-height: 450px;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-text {
    flex: 1;
    padding: 60px 40px;
    text-align: right;
}

.slide h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: var(--primary);
    line-height: 1.3;
}

.slide p {
    font-size: 1.2rem;
    color: var(--text-main);
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: var(--glass);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Features Grid */
.features {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.feature-card {
    background: var(--bg-card);
    padding: 0;
    border-radius: 24px;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--primary);
}

.feature-img {
    width: 100%;
    height: auto;
    overflow: visible; /* Changed to visible for 3D overflow */
    padding: 20px;
    perspective: 1000px;
    display: flex;
    justify-content: center;
}

.feature-img img {
    width: 90%;
    height: auto;
    display: block;
    transition: var(--transition);
    border-radius: 15px;
    box-shadow: 
        10px 10px 30px rgba(0,0,0,0.5),
        -2px -2px 10px rgba(255,255,255,0.05);
    transform: rotateY(-15deg) rotateX(10deg);
    border: 1px solid rgba(255,255,255,0.1);
}

.feature-card:hover .feature-img img {
    transform: rotateY(0deg) rotateX(0deg) scale(1.05);
}

.whatsapp-theme .feature-img {
    position: relative;
    border-bottom: 3px solid #25d366;
}

.whatsapp-theme .feature-img::after {
    content: 'WhatsApp';
    position: absolute;
    top: 10px;
    left: 10px;
    background: #25d366;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    font-family: var(--font-en);
}

.barcode-card .feature-img {
    position: relative;
}

.overlay-product {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(-15deg) rotateX(10deg);
    width: 120px;
    height: auto;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
    animation: scanPulse 2s infinite ease-in-out;
}

.overlay-product img {
    width: 100% !important;
    height: auto !important;
    transform: none !important; /* Don't apply the parent's 3D rotation to the inner img twice */
    box-shadow: none !important;
    border: none !important;
}

@keyframes scanPulse {
    0%, 100% { transform: translate(-50%, -55%) rotateY(-15deg) rotateX(10deg); opacity: 0.9; }
    50% { transform: translate(-50%, -45%) rotateY(-15deg) rotateX(10deg); opacity: 1; }
}

.feature-card h3 {
    margin: 20px 20px 10px;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--text-muted);
    padding: 0 20px 20px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-dark);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        flex-direction: column;
        padding: 100px 20px 60px;
        text-align: center;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero h1 { font-size: 2.5rem; }
    .slide-content {
        flex-direction: column;
    }

    .slide-image {
        width: 100%;
        min-height: 250px;
    }

    .slide-text {
        padding: 40px 20px;
        text-align: center;
    }

    .slide h2 { font-size: 1.8rem; }
}
