/* ==========================================================================
   Minfarah Auto - Custom Styles
   ========================================================================== */

:root {
    --font-ar: 'Cairo', sans-serif;
    --font-en-fr: 'Poppins', sans-serif;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-accent: #f59e0b;
    --color-accent-dark: #d97706;
    --shadow-soft: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-brand: 0 10px 30px rgba(37, 99, 235, 0.18);
    --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #f8fafc 50%, #eef2ff 100%);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ============ Base ============ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-en-fr);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
    overflow-x: hidden;
}

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

/* ============ Hero Section ============ */
.hero-bg {
    background: var(--gradient-hero);
    position: relative;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero-title-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 50%, #0f172a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary-dark);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-cta-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-brand);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.hero-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 35px rgba(37, 99, 235, 0.25); }

.hero-cta-secondary {
    background: white;
    color: var(--color-primary-dark);
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.hero-cta-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }

/* Trust stats row */
.trust-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}
.trust-stat-number {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}
.trust-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ============ Feature Cards ============ */
.feature-card {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(37, 99, 235, 0.3);
}
.feature-icon-wrap {
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    margin-bottom: 1rem;
}

/* ============ Car Cards ============ */
.card-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}
.card-hover-effect:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.12);
    border-color: var(--color-primary);
}

.car-card-image-wrap {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}
.car-card-image-wrap img {
    transition: transform 0.5s ease;
}
.card-hover-effect:hover .car-card-image-wrap img {
    transform: scale(1.05);
}

.car-price-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
[dir="rtl"] .car-price-badge { left: auto; right: 0.75rem; }

.car-year-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(15, 23, 42, 0.75);
    color: white;
    padding: 0.3rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
[dir="rtl"] .car-year-badge { right: auto; left: 0.75rem; }

.car-spec-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
}
.car-spec-item svg { width: 1rem; height: 1rem; color: var(--color-primary); }

.car-book-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 0.6rem;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.car-book-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }

/* ============ Fade-in Animation ============ */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #e2e8f0; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dark); }

/* ============ FAQ ============ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.faq-item { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.faq-item:hover { box-shadow: var(--shadow-soft); border-color: rgba(37, 99, 235, 0.3); }

/* ============ Loader ============ */
.car-wheel-loader { animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ============ SEO Hidden ============ */
.seo-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============ Header ============ */
#header {
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    backdrop-filter: saturate(180%) blur(8px);
    background-color: rgba(255, 255, 255, 0.92);
}

.nav-link {
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.25s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* ============ Buttons ============ */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.6rem;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-brand);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(37, 99, 235, 0.3); }

/* ============ Floating Buttons ============ */
.whatsapp-float {
    background: #25D366;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    animation: pulse-ring 2.5s infinite;
}
.whatsapp-float:hover { background: #22c55e; transform: scale(1.08); }

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5), 0 8px 24px rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0), 0 8px 24px rgba(37, 211, 102, 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0), 0 8px 24px rgba(37, 211, 102, 0.4); }
}

/* ============ Mobile optimizations ============ */
@media (max-width: 768px) {
    .card-hover-effect { transition: none; }
    .card-hover-effect:hover { transform: none; }
    .fade-in-section { transition: opacity 0.3s ease-out; }
    button, a { min-height: 44px; }
    .shadow-lg, .shadow-md { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
    .hero-bg::before { display: none; }
}

/* ============ Language menu ============ */
.lang-switcher {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.5rem 0.875rem;
    font-weight: 600;
    color: #334155;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}
.lang-switcher:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ============ RTL adjustments ============ */
[dir="rtl"] body { font-family: var(--font-ar); }
[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* ============ Blog ============ */
.blog-hero {
    background: var(--gradient-hero);
    padding: 4rem 1rem 3rem;
    position: relative;
}

.blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.12);
    border-color: var(--color-primary);
}
.blog-card-img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
.blog-card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.blog-card-meta .category {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary-dark);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-weight: 600;
}
.blog-card h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; line-height: 1.4; margin-bottom: 0.6rem; }
.blog-card p { color: #64748b; font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; flex: 1; }
.blog-card .read-more {
    color: var(--color-primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
}
.blog-card .read-more:hover { color: var(--color-primary-dark); }

/* Article typography */
.article-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #334155;
}
.article-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
}
.article-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 2rem 0 0.75rem;
}
.article-content p { margin-bottom: 1.25rem; }
.article-content ul, .article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    padding-inline-start: 1.25rem;
}
[dir="rtl"] .article-content ul, [dir="rtl"] .article-content ol {
    margin: 1rem 1.5rem 1.5rem 0;
}
.article-content li { margin-bottom: 0.5rem; list-style: disc; }
.article-content ol li { list-style: decimal; }
.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
}
.article-content a:hover { color: var(--color-primary-dark); }
.article-content blockquote {
    border-inline-start: 4px solid var(--color-primary);
    background: #eff6ff;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
    font-style: italic;
    color: #334155;
}
.article-content img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-soft);
}
.article-content strong { color: #0f172a; font-weight: 700; }
.article-callout {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}
.article-callout h3 { margin-top: 0; }
.whatsapp-btn { background: #16a34a !important; }
.whatsapp-btn:hover { background: #15803d !important; }

.article-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
}
.article-toc strong { display: block; margin-bottom: 0.5rem; color: #0f172a; }
.article-toc ol { margin: 0; padding-inline-start: 1.25rem; }
.article-toc li { margin-bottom: 0.35rem; }
.article-toc a { color: var(--color-primary); font-weight: 500; }

.article-share {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    align-items: center;
    flex-wrap: wrap;
}
.article-share span { font-weight: 600; color: #334155; }
.article-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #334155;
    transition: all 0.2s ease;
}
.article-share a:hover { background: var(--color-primary); color: white; }

/* ============ Utility ============ */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
