/* ============================================================
   i-Fatoora Landing V2 - Custom Styles
   Design System: Modern SaaS (Stripe/Linear inspired)
   ============================================================ */

/* ---- Smooth scrolling ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* ---- Selection color ---- */
::selection {
    background-color: rgba(0, 106, 179, 0.15);
    color: #006AB3;
}

/* ---- Navbar styles ---- */
#navbar .nav-logo {
    filter: brightness(0) saturate(100%);
    transition: filter 0.3s ease;
}

#navbar.scrolled .nav-logo {
    filter: brightness(0) saturate(100%);
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ---- Float animation for hero badges ---- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

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

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

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

/* ---- Gradient animation for hero background ---- */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
}

/* ---- Shimmer animation for text ---- */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.text-shimmer {
    background: linear-gradient(90deg, #006AB3 0%, #51D173 50%, #006AB3 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ---- Glowing border animation ---- */
@keyframes glow-border {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 106, 179, 0.1),
                    0 0 40px rgba(81, 209, 115, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 106, 179, 0.2),
                    0 0 60px rgba(81, 209, 115, 0.1);
    }
}

.glow-border {
    animation: glow-border 2s ease-in-out infinite;
}

/* ---- Pulse animation ---- */
@keyframes pulse-scale {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.animate-pulse-scale {
    animation: pulse-scale 2s ease-in-out infinite;
}

/* ---- Ripple effect ---- */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ---- 3D Card tilt effect ---- */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale3d(1.02, 1.02, 1.02);
}

/* ---- Magnetic button effect ---- */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Enhanced button glow on hover ---- */
.btn-primary {
    position: relative;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 0.75rem;
    background: linear-gradient(45deg, #006AB3, #51D173, #006AB3);
    background-size: 300% 300%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    animation: gradient-shift 3s ease infinite;
}

.btn-primary:hover::before {
    opacity: 0.3;
    filter: blur(8px);
}

/* ---- Backdrop blur parallax layers ---- */
.parallax-layer {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Stagger animation delays ---- */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ---- Ripple effect animation ---- */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---- Scroll-triggered fade-up animation ---- */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="fade-up"].animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Feature card hover glow ---- */
.feature-card {
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: background 0.3s ease;
}

.feature-card:hover::before {
    background: linear-gradient(135deg, rgba(0, 106, 179, 0.1), rgba(81, 209, 115, 0.1));
}

/* ---- Pricing card hover lift ---- */
.pricing-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

/* ---- Sector card subtle hover ---- */
.sector-card {
    transition: all 0.3s ease;
}

/* ---- Button hover animation ---- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

/* ---- Form input focus glow ---- */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 106, 179, 0.1);
}

/* ---- Gradient text utility ---- */
.gradient-text {
    background: linear-gradient(135deg, #006AB3, #51D173);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Counter animation ---- */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive adjustments ---- */
@media (max-width: 640px) {
    /* Ensure proper RTL text alignment on mobile */
    #hero h1 {
        font-size: 1.875rem;
        line-height: 1.3;
    }

    /* Full-width CTA on mobile */
    .btn-primary,
    .pricing-card a {
        width: 100%;
        text-align: center;
    }

    /* Stack pricing cards nicely */
    .pricing-card {
        margin-bottom: 1rem;
    }

    /* Reduce padding on mobile */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Hero badges hidden on very small screens */
    .animate-float,
    .animate-float-delayed {
        display: none;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .animate-float,
    .animate-float-delayed {
        display: flex;
    }
}

/* ---- Loading state for contact form ---- */
form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---- Pulse animation for ZATCA badge ---- */
@keyframes subtle-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(81, 209, 115, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(81, 209, 115, 0); }
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out 1s infinite, subtle-pulse 3s ease-in-out infinite;
}

/* ---- Custom scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---- Blog Article Typography (prose-article) ---- */
.prose-article {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #334155;
}

.prose-article h1,
.prose-article h2,
.prose-article h3,
.prose-article h4,
.prose-article h5,
.prose-article h6 {
    color: #0f172a;
    font-weight: 800;
    line-height: 1.35;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.prose-article h1 { font-size: 2rem; }
.prose-article h2 { font-size: 1.625rem; }
.prose-article h3 { font-size: 1.375rem; }
.prose-article h4 { font-size: 1.125rem; }

.prose-article p {
    margin-bottom: 1.25em;
}

.prose-article a {
    color: #006AB3;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.prose-article a:hover {
    color: #004a80;
}

.prose-article img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5em 0;
}

.prose-article ul,
.prose-article ol {
    margin: 1em 0;
    padding-right: 1.5em;
}

.prose-article ul { list-style: disc; }
.prose-article ol { list-style: decimal; }

.prose-article li {
    margin-bottom: 0.5em;
}

.prose-article blockquote {
    border-right: 4px solid #006AB3;
    padding: 1em 1.5em;
    margin: 1.5em 0;
    background: #f8fafc;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #475569;
    font-style: italic;
}

.prose-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9375rem;
}

.prose-article th,
.prose-article td {
    padding: 0.75em 1em;
    border: 1px solid #e2e8f0;
    text-align: right;
}

.prose-article th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
}

.prose-article pre,
.prose-article code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.prose-article code {
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 0.375rem;
    color: #006AB3;
}

.prose-article pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1.25em;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose-article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.prose-article hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 2em 0;
}

.prose-article figure {
    margin: 1.5em 0;
}

.prose-article figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.5em;
}

/* ---- Line clamp utility ---- */
.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;
}
