/* Case Studies Specific Styles - AWS-inspired Layout */

/* Hero Section for Case Studies */
.case-studies-hero {
    background: linear-gradient(135deg, var(--flowmai-secondary) 0%, rgba(255, 248, 240, 0.7) 100%);
    padding: 120px 0 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--flowmai-dark);
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-btn.active {
    background: var(--flowmai-primary);
    color: white;
}

/* Featured Case Study */
.featured-case-study {
    padding: 60px 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* First and third case studies have white background */
.featured-case-study:nth-of-type(odd) {
    background-color: var(--bg-primary);
}

/* Second case study has gray background */
.featured-case-study:nth-of-type(2) {
    background-color: var(--bg-secondary);
}

.featured-case-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

/* First and third case studies have content on left, image on right */
.featured-case-study:nth-of-type(odd) .featured-case-wrapper {
    grid-template-columns: 1fr 1fr;
    direction: ltr;
}

/* Second case study has image on left, content on right */
.featured-case-study:nth-of-type(2) .featured-case-wrapper {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.featured-case-study:nth-of-type(2) .featured-content,
.featured-case-study:nth-of-type(2) .featured-image {
    direction: ltr;
}

.featured-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--flowmai-dark);
}

.featured-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.featured-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.featured-metric {
    display: flex;
    flex-direction: column;
}

.featured-metric .metric-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--flowmai-primary);
    line-height: 1;
}

.featured-metric .metric-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.featured-image {
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image {
    background: #e0e0e0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: #666;
}

/* Case Details Section */
.case-details {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, max-height 0.5s ease, padding 0.3s ease;
    will-change: max-height, opacity, padding;
    visibility: hidden;
}

.case-details.active {
    opacity: 1;
    max-height: 3000px; /* Increased to ensure enough room for all content */
    padding-top: 2rem;
    visibility: visible;
}

/* Challenge, Solution, Results sections */
.challenge-section,
.solution-section,
.results-section {
    margin-top: 2rem;
}

.challenge-section h4,
.solution-section h4,
.results-section h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--flowmai-dark);
    margin-bottom: 1.5rem;
    position: relative;
}

.challenge-section h4::before {
    content: "";
}

.solution-section h4::before {
    content: "";
}

.results-section h4::before {
    content: "";
}

/* Pain Points */
.pain-points {
    margin-top: 1.5rem;
}

.pain-points ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* List Item Styling - Unified */
.pain-points li,
.automation-features li {
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.8rem;
}

/* Pain Points specific styling */
.pain-points li {
    padding: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Automation Features */
.automation-features {
    margin-top: 1.5rem;
}

.automation-features ul,
.pain-points ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Automation Features specific styling */
.automation-features li {
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.automation-features li strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--flowmai-dark);
    margin-bottom: 0.5rem;
}

.automation-features li p {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Customer Quote */
.customer-quote {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--flowmai-dark);
    font-style: italic;
    margin: 2rem 0 1rem 0;
    padding: 2rem;
    background: var(--flowmai-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--flowmai-primary);
    position: relative;
    font-family: serif;
}

.quote-author {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-style: normal;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.metric {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--white);
    border-radius: 12px;
    border: 2px solid var(--border-light);
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--flowmai-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Result Highlight */
.result-highlight {
    background: var(--flowmai-primary);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.result-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.result-label {
    font-size: 1.1rem;
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.cta-section .section-title {
    color: var(--flowmai-dark);
}

.cta-subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cta-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* AWS-inspired Responsive Styles */
@media (max-width: 992px) {
    .featured-case-wrapper {
        grid-template-columns: 1fr !important;
        direction: ltr !important;
    }
    
    .featured-title {
        font-size: 2rem;
    }
    
    .featured-image {
        order: -1;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .category-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .featured-metrics {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .case-studies-hero {
        padding: 100px 0 40px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .featured-title {
        font-size: 1.75rem;
    }
}