/* ==========================================================================
   Marhaba - Maintenance Center
   Main Stylesheet - Mobile First
   ========================================================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #0f766e;
    --primary-dark: #0d5d56;
    --primary-light: #14b8a6;
    --primary-lighter: #ccfbf1;
    
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fbbf24;
    
    --whatsapp: #25d366;
    --whatsapp-dark: #1da851;
    
    --dark: #0f172a;
    --gray-900: #1e293b;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50: #f8fafc;
    --white: #ffffff;
    
    --success: #22c55e;
    --danger: #ef4444;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Typography */
    --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 64px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-900);
    background: var(--gray-50);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    padding-bottom: 70px; /* Space for mobile bottom bar */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   Top Bar
   ========================================================================== */
.top-bar {
    background: var(--gray-900);
    color: var(--white);
    font-size: 12px;
    padding: 8px 0;
    display: none;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.top-bar-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-bar-text svg {
    opacity: 0.7;
}

@media (min-width: 768px) {
    .top-bar {
        display: block;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    background: var(--white);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    gap: 12px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
}

.logo:hover {
    color: var(--primary);
}

.logo-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.logo-tagline {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}

@media (min-width: 480px) {
    .logo-name {
        font-size: 24px;
    }
    .logo-tagline {
        font-size: 12px;
    }
}

/* Header Actions (Icons) */
.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.25s ease;
    box-shadow: var(--shadow-md);
    position: relative;
}

.btn-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    background: inherit;
    opacity: 0.3;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.15); opacity: 0; }
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-call {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.btn-whatsapp {
    background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp));
}

/* Navigation */
.main-nav {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: none;
}

@media (min-width: 768px) {
    .main-nav {
        display: block;
    }
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 0;
}

.nav-list a {
    display: inline-block;
    padding: 10px 16px;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-list a:hover, .nav-list a.active {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 0;
    font-size: 13px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb li:not(:last-child)::after {
    content: '‹';
    color: var(--gray-400);
    font-weight: 700;
    margin-right: 6px;
}

.breadcrumb a {
    color: var(--gray-500);
}

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

.breadcrumb li:last-child span {
    color: var(--gray-900);
    font-weight: 600;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 40px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

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

.hero h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
    color: rgba(255,255,255,0.95);
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.hero-feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-feature svg {
    width: 16px;
    height: 16px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 16px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-secondary {
    background: var(--whatsapp);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--whatsapp-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
    color: var(--white);
}

@media (min-width: 768px) {
    .hero {
        padding: 60px 0 80px;
    }
    .hero h1 {
        font-size: 42px;
    }
    .hero-subtitle {
        font-size: 18px;
    }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
    padding: 48px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--dark);
    text-align: center;
}

.section-subtitle {
    font-size: 15px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .section {
        padding: 64px 0;
    }
    .section-title {
        font-size: 32px;
    }
}

/* ==========================================================================
   Cards Grid
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
}

.card-text {
    font-size: 12px;
    color: var(--gray-500);
}

/* ==========================================================================
   Features Grid
   ========================================================================== */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-item {
    background: var(--white);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.7;
}

/* ==========================================================================
   Content Section
   ========================================================================== */
.content-section {
    background: var(--white);
    padding: 32px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.content-section h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark);
    margin: 24px 0 12px;
    padding-right: 12px;
    border-right: 4px solid var(--primary);
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 16px 0 8px;
}

.content-section p {
    margin-bottom: 12px;
    color: var(--gray-700);
    line-height: 1.8;
}

.content-section ul, .content-section ol {
    margin: 16px 0;
    padding-right: 24px;
}

.content-section li {
    margin-bottom: 8px;
    color: var(--gray-700);
    line-height: 1.7;
}

.services-list li::marker {
    color: var(--primary);
    font-weight: 700;
}

.steps-list li {
    margin-bottom: 12px;
    padding-right: 8px;
}

.steps-list li::marker {
    color: var(--accent);
    font-weight: 700;
}

.tips-list li {
    padding: 8px 12px;
    background: var(--primary-lighter);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    list-style: none;
    position: relative;
    padding-right: 32px;
}

.tips-list li::before {
    content: '✓';
    position: absolute;
    right: 10px;
    color: var(--primary);
    font-weight: 800;
}

@media (min-width: 768px) {
    .content-section {
        padding: 40px;
    }
    .content-section h2 {
        font-size: 26px;
    }
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
    background: var(--white);
    padding: 32px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.faq-item {
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    user-select: none;
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    color: var(--primary);
    font-weight: 700;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question::after {
    content: '−';
}

.faq-answer {
    color: var(--gray-700);
    line-height: 1.8;
    font-size: 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    margin-top: 12px;
}

@media (min-width: 768px) {
    .faq-section {
        padding: 40px;
    }
    .faq-question {
        font-size: 18px;
    }
    .faq-answer {
        font-size: 16px;
    }
}

/* ==========================================================================
   CTA Block (Inline Call-to-Action)
   ========================================================================== */
.cta-block {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    margin: 24px 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.cta-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.cta-block h3 {
    position: relative;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cta-block p {
    position: relative;
    font-size: 15px;
    margin-bottom: 20px;
    opacity: 0.95;
}

.cta-block .hero-cta {
    position: relative;
    justify-content: center;
}

/* ==========================================================================
   Brand Logo Grid (Brands Section)
   ========================================================================== */
.brand-card {
    background: var(--white);
    padding: 20px 12px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--gray-200);
    color: var(--gray-900);
}

.brand-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-dark);
}

.brand-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 8px;
}

.brand-card-name {
    font-size: 14px;
    font-weight: 700;
}

/* ==========================================================================
   Mobile Bottom Bar
   ========================================================================== */
.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    display: flex;
    gap: 0;
    z-index: 999;
    border-top: 1px solid var(--gray-200);
}

.mb-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    transition: opacity 0.2s ease;
}

.mb-btn:active {
    opacity: 0.8;
    color: var(--white);
}

.mb-call {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.mb-wa {
    background: linear-gradient(135deg, var(--whatsapp-dark), var(--whatsapp));
}

.mb-btn svg {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .mobile-bottom-bar {
        display: none;
    }
    body {
        padding-bottom: 0;
    }
}

/* Floating Call button (Top-Right - Always visible) */
.floating-call {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    z-index: 998;
    transition: transform 0.25s ease;
}

.floating-call::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-full);
    background: var(--primary);
    opacity: 0.4;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

.floating-call:hover, .floating-call:active {
    transform: scale(1.1);
    color: var(--white);
}

/* Floating WhatsApp button (Desktop) - removed - using top-right call only */
.floating-wa {
    display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--dark);
    color: var(--gray-300);
    padding: 48px 0 0;
    margin-top: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1.5fr repeat(4, 1fr);
    }
}

.footer-col h4 {
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 2px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-logo strong {
    color: var(--white);
    font-size: 22px;
    font-weight: 800;
}

.footer-text {
    color: var(--gray-400);
    line-height: 1.7;
    font-size: 14px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--gray-400);
    font-size: 13px;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-light);
    transform: translateX(-4px);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding: 24px 0;
    margin-top: 32px;
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    line-height: 1.7;
}

/* ==========================================================================
   Hero Image Block (Brand+Device pages)
   ========================================================================== */
.hero-image {
    position: relative;
    margin-top: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: rgba(255,255,255,0.1);
}

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

/* ==========================================================================
   Service Image inside content
   ========================================================================== */
.content-image {
    width: 100%;
    border-radius: var(--radius-md);
    margin: 16px 0;
    box-shadow: var(--shadow-md);
}

.content-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .content-image-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.content-image-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Helpers
   ========================================================================== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }

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

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Loading spinner if needed */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Print friendly */
@media print {
    .header, .footer, .mobile-bottom-bar, .floating-wa, .breadcrumb { display: none; }
    body { background: white; padding: 0; }
}
