/* ========================================
   Modern Features Page Redesign
   ======================================== */

/* Hero Redesign */
.features-hero {
    padding: 180px 0 100px;
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.has-mesh-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(at 20% 30%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 20%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 30% 80%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
    animation: rotate-mesh 60s linear infinite;
    pointer-events: none;
}

@keyframes rotate-mesh {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.features-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.highlight-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.hero-lead {
    font-size: 1.35rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Showcase Items */
.features-showcase {
    padding-top: 40px;
}

.showcase-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    margin-bottom: 140px;
}

.showcase-item.reversed {
    direction: ltr;
    /* Visually reverse order */
}

/* Restore RTL text for content in reversed/LTR container */
.showcase-item.reversed .showcase-content {
    direction: rtl;
    text-align: right;
}

.showcase-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.showcase-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Feature Icon Boxes */
.feature-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

/* Specific Gradients */
.whatsapp-gradient {
    background: linear-gradient(135deg, #25d366, #128c7e);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3);
}

.ai-gradient {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.products-gradient {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

.widget-gradient {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.3);
}

.leads-gradient {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

/* Checklist */
.feature-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 500;
}

.feature-checklist li svg {
    color: var(--green);
    /* Or match section color */
    width: 20px;
    height: 20px;
}

/* Abstract UI Canvas */
.showcase-visual {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    height: 400px;
    /* Fixed height for consistency */
    position: relative;
    overflow: hidden;
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Subtle inner mesh */
    background-image: radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.03) 0%, transparent 40%);
}

/* --- Abstract UI Elements --- */

/* 1. WhatsApp UI Mock */
.whatsapp-ui {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(20px);
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: slideUpFade 0.5s ease forwards;
    opacity: 0;
}

.chat-bubble.incoming {
    background: white;
    align-self: flex-end;
    /* RTL: left */
    border-bottom-right-radius: 2px;
    margin-right: auto;
    /* Push to left */
    margin-left: 0;
    border: 1px solid #f0f0f0;
}

.chat-bubble.outgoing {
    background: #dcf8c6;
    align-self: flex-start;
    /* RTL: right */
    border-bottom-left-radius: 2px;
    margin-left: auto;
    /* Push to right */
    margin-right: 0;
}

.whatsapp-ui .chat-bubble:nth-child(1) {
    animation-delay: 0s;
}

.whatsapp-ui .chat-bubble:nth-child(2) {
    animation-delay: 0.8s;
}

.whatsapp-ui .chat-bubble:nth-child(3) {
    animation-delay: 1.6s;
}

/* 2. AI Brain Pulse */
.ai-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.brain-pulse {
    width: 80px;
    height: 80px;
    background: var(--purple-light);
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brain-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--purple);
    animation: pulse-ring 2s infinite;
}

.processing-node {
    background: white;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.processing-node span {
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-purple);
    animation: loadBar 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes loadBar {
    0% {
        width: 0%;
        transform: translateX(-100%);
    }

    50% {
        width: 100%;
        transform: translateX(0);
    }

    100% {
        width: 100%;
        transform: translateX(100%);
    }

    /* simple illusion */
}

/* 3. Product Cards */
.products-ui {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.product-card-mock {
    width: 140px;
    height: 180px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.product-card-mock.active {
    transform: scale(1.1);
    border-color: var(--orange);
    box-shadow: var(--shadow-lg);
    z-index: 2;
}

.img-placeholder {
    flex: 1;
    background: #f1f5f9;
    border-radius: 8px;
}

.line {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
}

.line.lg {
    width: 80%;
}

.line.sm {
    width: 40%;
}

.match-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--orange);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 99px;
    font-weight: bold;
}

/* 4. Widget UI */
.widget-ui {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-widget-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    /* LTR visual in reversed container */
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
    animation: bounce-subtle 3s infinite;
}

.widget-window {
    position: absolute;
    bottom: 110px;
    right: 40px;
    width: 260px;
    height: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.widget-header {
    height: 60px;
    background: var(--gradient-primary);
}

.widget-body {
    padding: 20px;
}

.msg {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    border-top-left-radius: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 5. Leads UI */
.leads-ui {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 300px;
}

.lead-row {
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
}

.lead-row:nth-child(1) {
    animation-delay: 0.2s;
}

.lead-row:nth-child(2) {
    animation-delay: 0.6s;
    opacity: 0.5;
    transform: scale(0.95);
}

.lead-row .avatar {
    width: 40px;
    height: 40px;
    background: #e2e8f0;
    border-radius: 50%;
}

.lead-row .info-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lead-row .status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.lead-row .status.success {
    background: var(--green-light);
    color: var(--green);
}

.lead-row .status.pending {
    background: #fff7ed;
    color: #f97316;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .showcase-item {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        margin-bottom: 100px;
    }

    .showcase-item.reversed {
        direction: rtl;
        /* Reset direction */
    }

    .showcase-item.reversed .showcase-content {
        text-align: right;
        /* Maintain RTL text align even on mobile if preferred, or center */
        text-align: center;
    }

    .feature-checklist {
        align-items: center;
        /* Center list items */
    }

    .feature-icon-box {
        margin: 0 auto 24px;
    }
}