/* =============================================
   Marklix Agency — Main Stylesheet
   ============================================= */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Cairo', sans-serif; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* Utility classes */
.page-fade    { animation: pageFade .35s ease; }
.toast        { animation: toastIn .4s cubic-bezier(.175,.885,.32,1.275); }
.animate-float{ animation: float 3s ease-in-out infinite; }

.nav-link { position: relative; }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 2px;
    background: #5DCAA5;
    border-radius: 2px;
}

/* Hero grid background */
.hero-grid {
    background-image:
        linear-gradient(rgba(93,202,165,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(93,202,165,.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Glow */
.glow-green { box-shadow: 0 4px 24px rgba(93,202,165,.35); }
.glow-green-sm { box-shadow: 0 2px 12px rgba(93,202,165,.25); }

/* Cards */
.card-hover {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
}

/* Line clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Prose styles for blog content */
.prose h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; color: #111827; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 .75rem; color: #111827; }
.prose p  { margin-bottom: 1.25rem; line-height: 1.8; color: #374151; }
.prose ul { list-style: disc; padding-inline-start: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: .5rem; line-height: 1.7; color: #374151; }
.prose a  { color: #1D9E75; text-decoration: underline; }
.prose blockquote { border-inline-start: 3px solid #5DCAA5; padding-inline-start: 1rem; color: #6b7280; font-style: italic; margin: 1.5rem 0; }
.prose img { border-radius: 1rem; margin: 1.5rem auto; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #5DCAA5; border-radius: 3px; }

/* WhatsApp button */
.whatsapp-btn { box-shadow: 0 4px 20px rgba(37,211,102,.4); }
.whatsapp-btn:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,.5); }

/* Section label */
.section-label {
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

/* RTL fixes */
[dir="rtl"] .arrow-icon { transform: scaleX(-1); }

/* =============================================
   Rich Editor Content — Frontend Rendering
   ============================================= */
.rich-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
}
.rich-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 1.5rem 0 0.5rem;
    line-height: 1.4;
}
.rich-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin: 1.2rem 0 0.4rem;
}
.rich-content p {
    margin-bottom: 1.25rem;
    line-height: 1.85;
    color: #374151;
}
.rich-content ul,
.rich-content ol {
    padding-inline-start: 1.75rem;
    margin-bottom: 1.25rem;
    color: #374151;
}
.rich-content li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}
.rich-content a {
    color: #1D9E75;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rich-content a:hover { color: #155f47; }
.rich-content strong, .rich-content b { font-weight: 700; }
.rich-content em, .rich-content i { font-style: italic; }
.rich-content blockquote {
    border-inline-start: 3px solid #5DCAA5;
    padding-inline-start: 1.25rem;
    color: #6b7280;
    font-style: italic;
    margin: 1.5rem 0;
    background: #f9fafb;
    padding: 1rem 1.25rem;
    border-radius: 0 0.5rem 0.5rem 0;
}
[dir="rtl"] .rich-content blockquote {
    border-inline-start: none;
    border-inline-end: 3px solid #5DCAA5;
    border-radius: 0.5rem 0 0 0.5rem;
}
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}
.rich-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1.25rem 0;
}
.rich-content code {
    background: #f3f4f6;
    color: #dc2626;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
.rich-content th {
    background: #f3f4f6;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: inherit;
}
.rich-content td {
    padding: 0.6rem 1rem;
    border: 1px solid #e5e7eb;
}
.rich-content tr:nth-child(even) { background: #f9fafb; }
.rich-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* RTL Arrow Fixes */
[dir="rtl"] .arrow-icon {
    transform: scaleX(-1);
}
[dir="rtl"] .group:hover .group-hover\:translate-x-1 {
    transform: translateX(-4px);
}

/* RTL Mobile grid fix for forms */
@media (max-width: 640px) {
    .form-grid-mobile {
        grid-template-columns: 1fr;
    }
}
[dir="rtl"] .form-grid-mobile {
    grid-template-columns: 1fr;
}

/* ===== MARKLIX DESIGN SYSTEM ===== */

/* Header */
.mk-header {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 50;
}

.mk-floating-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.mk-nav-link {
    color: #374151;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.mk-nav-link:hover {
    color: #1D9E75;
}

.mk-nav-link.active {
    color: #1D9E75;
}

/* Hero */
.mk-hero {
    min-height: 75vh;
    display: flex;
    align-items: center;
}

.mk-hero-content {
    max-width: 56rem;
    margin: 0 auto;
    text-align: center;
}

/* Sections */
.mk-section {
    padding: 5rem 0;
}

.mk-section-alt {
    background: #f9fafb;
}

/* Cards */
.mk-card {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.mk-card:hover {
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(29, 158, 117, 0.2);
}

/* Breadcrumb */
.mk-breadcrumb {
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.mk-breadcrumb-link {
    color: #6b7280;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.mk-breadcrumb-link:hover {
    color: #1D9E75;
}

/* Buttons */
.mk-btn-primary {
    background: #1D9E75;
    color: white;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px -3px rgba(29, 158, 117, 0.4);
}

.mk-btn-primary:hover {
    background: #178a63;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(29, 158, 117, 0.5);
}

.mk-btn-secondary {
    background: white;
    color: #374151;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.mk-btn-secondary:hover {
    border-color: #d1d5db;
    color: #111827;
}

/* Audience Cards */
.mk-audience-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: all 0.3s;
}

.mk-audience-card:hover {
    border-color: rgba(93, 202, 165, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

/* Section Title Badge */
.mk-section-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: rgba(29, 158, 117, 0.1);
    color: #1D9E75;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    margin-bottom: 1rem;
}
