/* Corex Signal AI - Feature Page Styles
    This file is loaded *after* style.css
*/

/* --- 1. Feature Hero Section --- */
.feature-hero-section {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
}

/* Dedicated background variant for the how-it-works page */
.feature-hero-section.hero-how-it-works {
    background: linear-gradient(145deg, rgba(4, 7, 23, 0.9), rgba(10, 17, 46, 0.8)),
        url('../images/how-it-works-bg.png') center/cover no-repeat;
    border-bottom: none;
    color: var(--color-text-light);
}

.feature-hero-section.hero-how-it-works::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0, 255, 157, 0.15), transparent 45%);
    pointer-events: none;
}

.feature-hero-section.hero-how-it-works .feature-hero-content {
    position: relative;
    z-index: 1;
}

.how-it-works-page .feature-hero-text h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #f4f7ff;
}

.how-it-works-page .feature-hero-text .subtitle {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 720px;
    margin: 0 auto;
}

.feature-hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

/* Swap hero columns in RTL so visual/text positions mirror correctly */
body.rtl .feature-hero-content .feature-hero-text { grid-column: 2; }
body.rtl .feature-hero-content .feature-hero-visual { grid-column: 1; }

.feature-hero-text .icon {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    display: block;
    line-height: 1;
}

.feature-hero-text h1 {
    font-size: 3.5rem;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.feature-hero-text .subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
    max-width: 600px;
}

.feature-hero-visual img {
    max-width: 100%;
    animation: float-animation 6s ease-in-out infinite;
}

/* --- 2. Feature Detail Section --- */
.feature-detail-section {
    padding: 6rem 0;
}

.feature-detail-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}

.how-architecture-section {
    padding: 5rem 0 1rem 0;
    background: linear-gradient(180deg, rgba(10, 15, 30, 0.9), rgba(10, 15, 30, 1));
}

.how-architecture-section .section-header {
    text-align: left;
    margin-bottom: 3rem;
}

.how-architecture-section .section-header h2 {
    font-size: 2.6rem;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.how-architecture-section .section-header p {
    max-width: 720px;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

.how-architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
}

.architecture-card {
    background: var(--color-bg-light);
    border: 1px solid rgba(0, 255, 157, 0.15);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    min-height: 250px;
}

.architecture-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.architecture-card h3 {
    font-size: 1.35rem;
    color: var(--color-text-primary);
    margin-bottom: 0.9rem;
}

.architecture-card p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.card-points {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0;
}

.card-points li {
    font-size: 0.95rem;
    color: var(--color-text-primary);
    padding-left: 1.3rem;
    position: relative;
}

.card-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

/* Alternating layout (LTR by default) */
.feature-detail-item:nth-child(even) .feature-detail-image {
    order: -1;
}

/* In RTL we want the alternate ordering reversed so layout mirrors visually */
body.rtl .feature-detail-item:nth-child(odd) .feature-detail-image {
    order: -1;
}

.feature-detail-image img {
    max-width: 100%;
    border-radius: var(--border-radius);
    /* border: 1px solid var(--color-border); */

    /* Combined shadow: subtle dark shadow + neon highlights */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), /* subtle dark shadow */
                0 0 25px rgba(0, 255, 157, 0.25), /* green glow */
                0 0 50px rgba(0, 200, 255, 0.15); /* blue glow */
}

/* --- 6. Placeholder Page --- */
.placeholder-section {
    padding: 8rem 0;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-light);
}

.placeholder-content {
    max-width: 600px;
    margin: 0 auto;
}

.placeholder-content .icon {
    font-size: 4rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    line-height: 1;
}

.placeholder-content h1 {
    font-size: 3rem;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.placeholder-content p {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
}

/* --- 7. FAQ Section --- */
.faq-section {
    padding: 6rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::after {
    content: '\f078'; /* FontAwesome chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(-180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.45s ease-out, opacity 0.3s ease;
}

.faq-item.active .faq-answer {
    /* Allow enough space for long answers; use opacity for visual reveal */
    max-height: 1000px;
    opacity: 1;
    pointer-events: auto;
}

.faq-answer p {
    padding: 0 2rem 2rem 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.feature-detail-text h2 {
    font-size: 2.2rem;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

.feature-detail-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.feature-detail-text ul {
    list-style: none;
}

.feature-detail-text ul li {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.feature-detail-text ul li i {
    color: var(--color-primary);
    margin-left: 10px;
    font-size: 1.2rem;
    margin-top: 5px;
}

/* --- 3. Testimonial Section --- */
.testimonial-section {
    padding: 6rem 0;
    background-color: var(--color-bg-light);
}

.testimonial-box {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem;
    background-color: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    position: relative;
}

.testimonial-box .quote-icon {
    font-size: 3rem;
    color: var(--color-primary);
    opacity: 0.3;
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

.testimonial-text {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--color-text-primary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
}

.author-info h4 {
    color: var(--color-text-primary);
    font-size: 1.1rem;
    margin: 0;
}

.author-info span {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* --- 4. Related Features Section --- */
.related-features-section {
    padding: 6rem 0;
}

/* Re-using .features-grid and .feature-card from style.css */
/* We just need to ensure the hover effect is still good */
.related-features-section .feature-card {
    background-color: var(--color-bg-light);
}

.related-features-section .feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 255, 157, 0.05);
}

.related-features-section .feature-card h3 {
    font-size: 1.3rem;
}

/* --- 5. Responsive Adjustments --- */
@media (max-width: 992px) {
    .feature-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .feature-hero-visual {
        margin-top: 3rem;
        order: -1;
    }
    .feature-hero-text h1 {
        font-size: 2.8rem;
    }
    
    .feature-detail-item {
        grid-template-columns: 1fr;
    }
    
    .feature-detail-item:nth-child(even) .feature-detail-image {
        order: 1; /* Stack in visual order */
    }
    
    .feature-detail-image {
        margin-top: 2rem;
    }
}

/* --- Final Feature Hero adjustments for visual balance --- */

.feature-hero-section {
    /* Use Flexbox to center content vertically */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh; /* ensure minimum height for adequate space */

    /* preserve existing padding */
    padding: 6rem 0; 
}

.feature-hero-content {
    /* ensure vertical centering when switching to flex */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-hero-text .icon {
    /* reduce bottom spacing of the icon to be closer to the title */
    margin-bottom: 0.8rem; /* reduced from 1.5rem to 0.8rem */
}

/* --- Mobile adjustments (when grid becomes single column) --- */
@media (max-width: 992px) {
    /* reduce top margin of the visual on mobile to avoid large gaps */
    .feature-hero-visual {
        margin-top: 2rem !important; /* reduce top spacing */
        margin-bottom: 2rem !important; /* reduce bottom spacing */
        /* order: -1; to place image above text on mobile */
    }

    .feature-hero-section {
        min-height: unset; /* remove fixed min-height on mobile */
        padding: 4rem 0;
    }
}

/* --- FAQ Professional Layout & Bug Fixes --- */
.faq-section {
    max-width: 980px;
    padding: 5.5rem 0;
}

.faq-section h1 {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    color: var(--color-text-primary);
}

.faq-section .section-desc {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2.25rem auto;
    color: var(--color-text-secondary);
    font-size: 1.05rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
}

.faq-item {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(13, 20, 41, 0.9), rgba(10, 15, 30, 0.92));
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.faq-item:hover {
    border-color: rgba(0, 255, 157, 0.28);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 255, 157, 0.08) inset;
    transform: translateY(-1px);
}

.faq-item.active {
    border-color: rgba(0, 255, 157, 0.35);
}

.faq-question {
    padding: 1.2rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.faq-question::after {
    content: none;
}

.faq-question span {
    color: var(--color-text-primary);
    font-weight: 700;
    line-height: 1.45;
    font-size: clamp(1.02rem, 1.8vw, 1.25rem);
}

.faq-question i {
    margin-inline-start: auto;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 255, 157, 0.36);
    background: rgba(0, 255, 157, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: transform 0.28s ease, background-color 0.28s ease, border-color 0.28s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(-180deg);
    background: rgba(0, 255, 157, 0.16);
    border-color: rgba(0, 255, 157, 0.62);
}

.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s ease, opacity 0.28s ease;
}

.faq-item.active .faq-answer {
    max-height: 1200px;
    opacity: 1;
}

.faq-answer p {
    padding: 0 1.35rem 1.35rem;
    color: #b9c5dd;
    font-size: 1rem;
    line-height: 1.9;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 3.25rem 0;
    }
    .faq-section .section-desc {
        margin-bottom: 1.4rem;
        font-size: 0.97rem;
        padding-inline: 0.25rem;
    }
    .faq-question {
        padding: 0.95rem 1rem;
        gap: 0.8rem;
    }
    .faq-question span {
        font-size: 1.02rem;
    }
    .faq-question i {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    .faq-answer p {
        padding: 0 1rem 1rem;
        font-size: 0.95rem;
        line-height: 1.8;
    }
    
    /* Feature detail gap reduce */
    .feature-detail-item {
        gap: 2rem;
        margin-bottom: 4rem;
    }
    .feature-detail-text h2 {
        font-size: 1.8rem;
    }
    .feature-detail-text p {
        font-size: 1rem;
    }
    
    /* How-it-works architecture grid */
    .how-architecture-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .architecture-card {
        min-height: auto;
    }
    
    /* Mobile RTL Support for Feature Pages */
    body.rtl .feature-hero-text,
    html[dir="rtl"] .feature-hero-text {
        text-align: right;
    }
    
    body.rtl .feature-detail-text,
    html[dir="rtl"] .feature-detail-text {
        text-align: right;
    }
    
    body.rtl .card-points li,
    html[dir="rtl"] .card-points li {
        padding-left: 0;
        padding-right: 1.3rem;
        text-align: right;
    }
    
    body.rtl .card-points li::before,
    html[dir="rtl"] .card-points li::before {
        left: auto;
        right: 0;
    }
    
    body.rtl .architecture-card,
    html[dir="rtl"] .architecture-card {
        text-align: right;
    }
    
    body.rtl .faq-question,
    html[dir="rtl"] .faq-question {
        text-align: right;
    }
    
    body.rtl .faq-answer p,
    html[dir="rtl"] .faq-answer p {
        text-align: right;
    }
}

/* Small phone adjustments for feature pages */
@media (max-width: 480px) {
    .feature-hero-section {
        min-height: unset;
        padding: 3rem 0;
    }
    .feature-hero-text h1 {
        font-size: 2rem;
    }
    .feature-hero-text .subtitle {
        font-size: 1rem;
    }
    .feature-hero-text .icon {
        font-size: 2.5rem;
    }
    .feature-detail-item {
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    .feature-detail-text h2 {
        font-size: 1.5rem;
    }
    .feature-detail-text p {
        font-size: 0.95rem;
    }
    .testimonial-text {
        font-size: 1.1rem;
    }
    .testimonial-box {
        padding: 2rem 1.5rem;
    }
    .placeholder-content h1 {
        font-size: 2rem;
    }
    .placeholder-content p {
        font-size: 1rem;
    }
    .how-architecture-section .section-header h2 {
        font-size: 2rem;
    }
    .architecture-card {
        padding: 1.25rem;
    }
    .faq-section {
        padding: 3rem 0;
    }
}