/* ==========================================================================
   SERVIX DESIGN SYSTEM - STYLESHEET
   ========================================================================== */

/* 1. Theme Configuration & Custom Variables */
:root {
    /* Functional Brand Accents (Global) */
    --primary: #2563eb;         /* Secondary blue requested */
    --primary-hover: #1d4ed8;
    --success: #22c55e;         /* Success green */
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Default: Light Mode Theme Variables */
    --bg-primary: #f8fafc;      /* Clean slate light background */
    --bg-secondary: #ffffff;    /* Pure white containers */
    --bg-card: #ffffff;
    --text-main: #0f172a;       /* Slate 900 (primary slate color) */
    --text-secondary: #475569;  /* Slate 600 */
    --text-muted: #94a3b8;      /* Slate 400 */
    --border-color: #e2e8f0;    /* Slate 200 */
    --shadow-main: 0 4px 20px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.1);
    
    /* Glassmorphism settings in light theme */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(226, 232, 240, 0.8);
    
    /* Font Configurations */
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Outfit', sans-serif;
    
    /* Speed Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme Variables Override */
[data-theme="dark"] {
    --bg-primary: #0f172a;      /* Primary Slate 900 background */
    --bg-secondary: #1e293b;    /* Slate 800 containers */
    --bg-card: #1e293b;
    --text-main: #f8fafc;       /* Slate 50 white */
    --text-secondary: #94a3b8;  /* Slate 400 */
    --text-muted: #64748b;      /* Slate 500 */
    --border-color: #334155;    /* Slate 700 */
    --shadow-main: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
    
    /* Glassmorphism settings in dark theme */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* 2. Bilingual Visibility Controller (RTL / LTR) */
html[lang="ar"] {
    direction: rtl;
    font-family: var(--font-ar);
}

html[lang="en"] {
    direction: ltr;
    font-family: var(--font-en);
}

/* Hide opposite language tags immediately */
html[lang="ar"] [lang="en"] {
    display: none !important;
}

html[lang="en"] [lang="ar"] {
    display: none !important;
}

/* 3. Global CSS Reset & Layout Foundations */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.grid {
    display: grid;
    gap: 30px;
}

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

a {
    text-decoration: none;
    color: inherit;
}

li {
    list-style: none;
}

button {
    font-family: inherit;
}

/* Glassmorphism Panel Setup */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-main);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Common Typography Utilities */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, var(--success) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-float {
    animation: float 5s ease-in-out infinite;
}

/* ================= SCROLL PROGRESS INDICATOR ================= */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    z-index: 1100;
}

/* ================= STICKY HEADER & NAV BAR ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    padding: 20px 0;
    border-bottom: 1px solid transparent;
    transition: background var(--transition-normal), padding var(--transition-normal), border-bottom var(--transition-normal);
}

.header.sticky {
    padding: 12px 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo Design */
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-en);
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    color: var(--text-main);
}

.logo-accent {
    color: var(--primary);
    font-weight: 900;
}

.logo-divider {
    margin: 0 8px;
    color: var(--border-color);
    font-weight: 300;
}

/* Nav Links */
.nav-list {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    padding: 6px 0;
    transition: color var(--transition-fast);
}

.nav-link:not(.nav-cta)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 50px;
    transition: width var(--transition-normal);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link:not(.nav-cta):hover::after, .nav-link:not(.nav-cta).active::after {
    width: 100%;
}

.nav-cta {
    background: var(--primary);
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.nav-cta:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);
}

/* Header Controls (Theme & Lang) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.control-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Theme Toggle sun/moon logic */
.theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
}

/* Hamburger menu button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: var(--transition-normal);
}

/* Expanded Hamburger state */
.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ================= MOBILE DRAWER ================= */
.mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-secondary);
    z-index: 1050;
    padding: 30px 24px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
}

/* RTL / LTR specific drawer placement */
html[lang="ar"] .mobile-drawer {
    right: 0;
    transform: translateX(100%);
}

html[lang="en"] .mobile-drawer {
    left: 0;
    transform: translateX(-100%);
}

html[lang="ar"] .mobile-drawer.open {
    transform: translateX(0);
}

html[lang="en"] .mobile-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.drawer-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-en);
}

.drawer-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
}

.drawer-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-link {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    padding: 6px 0;
}

.drawer-link:hover, .drawer-link.active {
    color: var(--primary);
}

.drawer-cta {
    background: var(--primary);
    color: #ffffff !important;
    text-align: center;
    border-radius: 8px;
    padding: 10px 0;
    margin-top: 10px;
}

.drawer-footer {
    margin-top: auto;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.drawer-website {
    color: var(--primary);
    margin-top: 6px;
    display: inline-block;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* ================= UTILITY PADDING & TITLES ================= */
.section-padding {
    padding: 100px 0;
}

.section-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    display: inline-block;
    padding: 4px 12px;
    background: rgba(37, 99, 235, 0.06);
    border-radius: 50px;
}

.section-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-main);
}

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

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1.5px);
}

.icon-spacing {
    /* Handle spacing spacing depending on the text direction */
    margin-right: 8px;
}
html[lang="ar"] .icon-spacing {
    margin-right: 0;
    margin-left: 8px;
}

/* ================= HERO SECTION (الرئيسية) ================= */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 130px 0 60px;
    overflow: hidden;
}

.hero-container {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 24px;
    box-shadow: var(--shadow-main);
}

.badge-dot {
    width: 7px;
    height: 7px;
    background-color: var(--primary);
    border-radius: 50%;
}

.hero-title {
    font-size: 2.85rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-main);
}

.hero-description {
    font-size: 1.08rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.hero-meta {
    display: flex;
    align-items: center;
}

.hero-link-domain {
    font-family: var(--font-en);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.hero-link-domain:hover {
    color: var(--primary);
}

.hero-link-domain i {
    margin-right: 6px;
}
html[lang="ar"] .hero-link-domain i {
    margin-right: 0;
    margin-left: 6px;
}

/* Owner Graphics Card */
.hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.visual-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.visual-glow-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(34, 197, 94, 0.05) 70%, transparent 100%);
    filter: blur(35px);
    pointer-events: none;
    z-index: 1;
}

.avatar-card {
    position: relative;
    z-index: 2;
    padding: 24px;
    text-align: center;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.avatar-image-container {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border-radius: 50%;
    position: relative;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary), var(--success));
    box-shadow: var(--shadow-main);
}

.owner-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--bg-secondary);
}

.avatar-status-badge {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-main);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
}

.avatar-info h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.avatar-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ================= SERVICES SECTION ================= */
.services-section {
    background-color: var(--bg-secondary);
}

.services-grid {
    grid-template-columns: repeat(3, 1fr);
}

.service-card {
    padding: 36px 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.service-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
}

.service-icon-wrapper::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    filter: blur(10px);
    opacity: 0.25;
    z-index: 1;
}

.service-icon {
    font-size: 1.35rem;
    z-index: 2;
}

/* Glow Accent Themes */
.blue-glow { background: rgba(37, 99, 235, 0.08); color: var(--primary); }
.blue-glow::after { background: var(--primary); }

.magenta-glow { background: rgba(236, 72, 153, 0.08); color: #ec4899; }
.magenta-glow::after { background: #ec4899; }

.cyan-glow { background: rgba(6, 182, 212, 0.08); color: #06b6d4; }
.cyan-glow::after { background: #06b6d4; }

.purple-glow { background: rgba(139, 92, 246, 0.08); color: #8b5cf6; }
.purple-glow::after { background: #8b5cf6; }

.gold-glow { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.gold-glow::after { background: var(--warning); }

.green-glow { background: rgba(34, 197, 94, 0.08); color: var(--success); }
.green-glow::after { background: var(--success); }

.service-title {
    font-size: 1.22rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.service-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Service Card Hover Micro-interactions */
.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
}

/* Expand 7th card to full span on wide screens */
.grid-span-full-mobile {
    grid-column: span 1;
}

/* ================= INTERACTIVE DEMO BUILDER ================= */
.demo-builder-section {
    background-color: var(--bg-primary);
}

.demo-tabs-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.demo-tab-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.demo-tab-btn i {
    font-size: 1rem;
}

.demo-tab-btn:hover, .demo-tab-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    box-shadow: var(--shadow-main);
}

.demo-grid {
    grid-template-columns: 0.9fr 1.1fr; /* Form left, Iframe right */
    align-items: start;
}

/* Left panel inputs */
.demo-controls-panel {
    padding: 30px;
    border-radius: 20px;
}

.demo-form {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.demo-form.active {
    display: flex;
}

.demo-form-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-main);
}

.demo-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.demo-form-group input,
.demo-form-group select,
.demo-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.demo-form-group input:focus,
.demo-form-group select:focus,
.demo-form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.1);
}

.demo-form-group textarea {
    height: 90px;
    resize: none;
}

/* Custom list items additions */
.demo-items-list-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-items-list-container h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.meal-item-row, .product-item-row {
    display: flex;
    gap: 10px;
}

.meal-item-row input, .product-item-row input {
    background: var(--bg-secondary) !important;
}

.meal-item-row .meal-name, .product-item-row .prod-name {
    flex-grow: 1;
}

.meal-item-row .meal-price, .product-item-row .prod-price {
    width: 80px;
}

/* Right panel device container */
.demo-preview-panel {
    display: flex;
    justify-content: center;
    width: 100%;
}

.device-mockup-wrapper {
    width: 100%;
    background: #0f172a;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    border: 6px solid #1e293b;
    display: flex;
    flex-direction: column;
    transition: max-width var(--transition-normal);
}

/* Toggle modes for device width simulations */
.device-mockup-wrapper.mode-desktop {
    max-width: 100%;
}

.device-mockup-wrapper.mode-mobile {
    max-width: 375px;
    margin: 0 auto;
}

.mockup-header {
    background: #1e293b;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
}

.mockup-dots {
    display: flex;
    gap: 6px;
}

.mockup-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

.mockup-address-bar {
    background: #0f172a;
    border-radius: 6px;
    padding: 4px 14px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-family: var(--font-en);
    display: flex;
    align-items: center;
    gap: 6px;
    width: 60%;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mockup-device-toggles {
    display: flex;
    gap: 8px;
}

.device-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    transition: var(--transition-fast);
}

.device-btn.active {
    color: #22d3ee;
}

/* Viewport structure */
.mockup-viewport {
    width: 100%;
    height: 520px;
    background: #ffffff;
    position: relative;
}

.mockup-viewport iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* ================= PORTFOLIO SECTION ================= */
.portfolio-section {
    background-color: var(--bg-secondary);
}

.portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
}

.portfolio-card {
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.portfolio-thumbnail {
    width: 100%;
    aspect-ratio: 1.45;
    background-color: var(--bg-primary);
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.portfolio-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-en);
    text-transform: uppercase;
}

.project-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.project-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.portfolio-card:hover .portfolio-thumbnail img {
    transform: scale(1.05);
}

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

/* ================= PRICING SECTION ================= */
.pricing-section {
    background-color: var(--bg-primary);
}

.pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
}

.pricing-card {
    padding: 40px 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.popular-card {
    position: relative;
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
}

.popular-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
}
html[lang="ar"] .popular-badge {
    left: auto;
    right: 16px;
}

.pricing-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.price-amount {
    font-family: var(--font-en);
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.pricing-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
    flex-grow: 1;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-features li i {
    color: var(--success);
    margin-top: 4px;
}

/* Custom Prompt panel */
.custom-pricing-prompt {
    margin-top: 60px;
    padding: 40px;
    border-radius: 20px;
}

.custom-pricing-prompt h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.custom-pricing-prompt p {
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 24px;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ================= CONSULTATION BOOKING ================= */
.booking-section {
    background-color: var(--bg-secondary);
}

.booking-grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.booking-info {
    padding-right: 20px;
}
html[lang="ar"] .booking-info {
    padding-right: 0;
    padding-left: 20px;
}

.booking-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 36px;
    line-height: 1.7;
}

.booking-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-card {
    display: flex;
    gap: 16px;
}

.step-num {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-weight: 800;
    font-family: var(--font-en);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* Booking form wrapper */
.booking-form-wrapper {
    padding: 36px;
    border-radius: 20px;
}

.booking-form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.1);
}

.field-error-msg {
    font-size: 0.76rem;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.form-group.invalid input,
.form-group.invalid select,
.form-group.invalid textarea {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.02);
}

.form-group.invalid .field-error-msg {
    display: block;
}

/* ================= CONTACT SECTION ================= */
.contact-section {
    background-color: var(--bg-primary);
}

.contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.contact-methods {
    display: flex;
    flex-direction: column;
}

.methods-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.method-card {
    padding: 20px;
    border-radius: 14px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.method-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.method-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ffffff;
    flex-shrink: 0;
}

.whatsapp-bg { background-color: var(--success); }
.email-bg { background-color: var(--primary); }
.developer-bg { background-color: #8b5cf6; }

.method-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

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

/* Send message wrapper */
.contact-form-wrapper {
    padding: 36px;
    border-radius: 20px;
}

.contact-form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-form-wrapper textarea {
    height: 110px;
    resize: none;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
}

/* ================= CONVERSION CTA POPUP MODAL ================= */
.conversion-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 520px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
}

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

.modal-content {
    padding: 40px 30px;
    border-radius: 24px;
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.modal-icon-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-headline {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.modal-actions-container {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.modal-action-btn {
    width: 100%;
}

.whatsapp-action-btn {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
}

.whatsapp-action-btn:hover {
    background: #16a34a !important;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.2) !important;
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition-fast);
}
html[lang="ar"] .modal-close-btn {
    right: auto;
    left: 18px;
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-blur-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-blur-overlay.active {
    display: block;
    opacity: 1;
}

/* ================= AI CHATBOT WIDGET ================= */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1020;
}
html[lang="ar"] .ai-chat-widget {
    right: auto;
    left: 30px;
}

/* Floating Chat Bubble trigger */
.ai-chat-trigger-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #ffffff;
    font-size: 1.35rem;
    cursor: pointer;
    position: relative;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.ai-chat-trigger-btn:hover {
    transform: scale(1.06);
}

.chat-pulsing-circle {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse-ring 2.5s infinite;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* The Dashboard Chat panel */
.ai-chat-window {
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 340px;
    height: 460px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
}
html[lang="ar"] .ai-chat-window {
    right: auto;
    left: 0;
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header info */
.chat-header {
    background: var(--primary);
    padding: 14px 18px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-status-robot-icon {
    font-size: 1.25rem;
}

.chat-title-info h4 {
    font-size: 0.88rem;
    font-weight: 700;
}

.chat-title-info p {
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

.chat-status-dot {
    width: 5px;
    height: 5px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.8;
}

.chat-close-btn:hover {
    opacity: 1;
}

/* Body messages scroll area */
.chat-messages-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-secondary);
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
}

.ai-bubble {
    background: var(--bg-primary);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
html[lang="ar"] .ai-bubble {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 2px;
}

.user-bubble {
    background: var(--primary);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}
html[lang="ar"] .user-bubble {
    border-bottom-right-radius: 12px;
    border-bottom-left-radius: 2px;
}

/* Chips quick triggers */
.chat-quick-chips {
    padding: 10px 14px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    scrollbar-width: none;
}
.chat-quick-chips::-webkit-scrollbar {
    display: none;
}

.chat-chip {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    padding: 6px 12px;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.chat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Input typing field bar */
.chat-input-bar {
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-input-bar input {
    flex-grow: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.85rem;
}

.chat-input-bar button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.chat-input-bar button:hover {
    background: var(--primary-hover);
}

/* ================= FOOTER SECTION ================= */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 70px;
}

.footer-grid {
    grid-template-columns: 1.2fr 0.8fr 1fr 1fr;
    margin-bottom: 50px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: var(--font-en);
    letter-spacing: 2px;
    color: var(--text-main);
    margin-bottom: 16px;
    display: inline-block;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 16px;
}

.footer-website-link {
    font-family: var(--font-en);
    font-weight: 600;
    color: var(--primary);
}

.footer-grid h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

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

/* Align list arrow icons depending on text layout */
.footer-links a i {
    font-size: 0.75rem;
    margin-right: 6px;
}
html[lang="ar"] .footer-links a i {
    margin-right: 0;
    margin-left: 6px;
    transform: rotate(0deg);
}
html[lang="en"] .footer-links a i {
    transform: rotate(180deg);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-list li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
}

.contact-list li i {
    color: var(--primary);
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.social-icon:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-copyright {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.copyright-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ================= BACK TO TOP BUTTON ================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}
html[lang="ar"] .back-to-top {
    right: auto;
    left: 30px;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* Adjust layout spacing spacing so chatbot button doesn't cover Back-to-Top */
html[lang="ar"] .ai-chat-widget {
    left: 85px; /* Offset to side-by-side */
}
html[lang="en"] .ai-chat-widget {
    right: 85px; /* Offset to side-by-side */
}


/* ==========================================================================
   RESPONSIVE LAYOUT ADJUSTMENTS (MEDIA BREAKPOINTS)
   ========================================================================== */

@media (max-width: 1024px) {
    .services-grid, .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    .pricing-grid > :nth-child(3) {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    /* Mobile Services Swipe Slider Layout */
    .services-grid {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth;
        gap: 20px !important;
        padding: 10px 4px 24px 4px !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .services-grid::-webkit-scrollbar {
        display: none !important;
    }
    
    .service-card {
        flex: 0 0 285px !important;
        scroll-snap-align: center !important;
        margin: 0 !important;
    }

    .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 50px;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .booking-grid, .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .booking-info {
        padding-left: 0;
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    
    .footer-links a i {
        display: none;
    }
    
    .contact-list li, .social-icons {
        justify-content: center;
    }
    
    .copyright-flex {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .portfolio-grid, .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-grid > :nth-child(3) {
        grid-column: span 1;
    }
    
    .hero-title {
        font-size: 1.85rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .booking-form-wrapper, .contact-form-wrapper {
        padding: 24px 16px;
    }
    
    .pricing-card {
        padding: 30px 20px;
    }
    
    .demo-controls-panel {
        padding: 20px 16px;
    }
    
    .device-mockup-wrapper {
        border-width: 3px;
    }
    
    .mockup-viewport {
        height: 450px;
    }
    
    .ai-chat-window {
        width: 280px;
        height: 400px;
    }
}
