/* Case Study Page Styles */

/* Hero Section */
.cs-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 40px 80px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.cs-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 139, 230, 0.15), transparent);
    pointer-events: none;
}

.cs-hero-content {
    max-width: 1000px;
    position: relative;
    z-index: 1;
}

.cs-category-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(34, 139, 230, 0.15);
    border: 1px solid rgba(34, 139, 230, 0.3);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #228BE6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

.cs-hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    margin: 0 0 24px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.cs-hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0 40px;
    line-height: 1.5;
}

.cs-hero-image {
    margin-top: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.cs-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
}

/* Quick Stats Bar */
.cs-stats-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 30px 40px;
    position: sticky;
    top: 75px;
    z-index: 90;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.cs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.cs-stat {
    text-align: center;
}

.cs-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 8px;
    line-height: 1;
}

.cs-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: visible; /* Allow tooltip to spill out */
}

/* Tooltip Styles */
.cs-info-icon {
    width: 14px;
    height: 14px;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.cs-info-icon:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.cs-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-tertiary); /* Dark bg for contrast */
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.cs-stat-label:hover .cs-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Arrow */
.cs-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

/* Content Sections */
.cs-section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.cs-section:nth-child(even) {
    background: var(--bg-secondary);
}

.cs-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.cs-section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.cs-section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Two Column Layout */
.cs-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    align-items: center;
}

@media (min-width: 900px) {
    .cs-two-col {
        grid-template-columns: 1fr 1fr;
    }

    .cs-two-col.reverse {
        direction: rtl;
    }

    .cs-two-col.reverse > * {
        direction: ltr;
    }
}

.cs-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.cs-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 20px;
}

.cs-content ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.cs-content li {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
    padding-left: 32px;
    position: relative;
}

.cs-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.cs-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.cs-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Metrics Grid */
.cs-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.cs-metric-card {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    padding: 40px 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(207, 91, 46, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cs-metric-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(207, 91, 46, 0.3);
}

.cs-metric-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.cs-metric-value {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin: 0 0 8px;
    line-height: 1;
}

.cs-metric-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.cs-metric-change {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.cs-metric-change.positive::before {
    content: '↑ ';
}

/* Feature Highlights */
.cs-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.cs-feature {
    background: var(--bg-tertiary);
    padding: 32px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.cs-feature:hover {
    border-color: var(--brand-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(207, 91, 46, 0.15);
}

.cs-feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.cs-feature h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.cs-feature p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Testimonial */
.cs-testimonial {
    background: linear-gradient(135deg, rgba(207, 91, 46, 0.1), rgba(244, 162, 97, 0.05));
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    margin: 60px 0;
    border: 1px solid rgba(207, 91, 46, 0.2);
}

.cs-testimonial-quote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cs-testimonial-quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--brand-primary);
    line-height: 0;
    display: block;
    margin-bottom: 20px;
}

.cs-testimonial-author {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.cs-testimonial-role {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Gallery */
.cs-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.cs-gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.cs-gallery-item:hover {
    transform: scale(1.05);
}

.cs-gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

/* CTA Section */
.cs-cta {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    padding: 100px 40px;
    text-align: center;
    border-radius: 24px;
    margin: 60px auto;
    max-width: 1200px;
}

.cs-cta h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: white;
    margin: 0 0 20px;
}

.cs-cta p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cs-cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Back Link */
.cs-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.2s ease;
}

.cs-back-link:hover {
    color: var(--brand-primary);
}

.cs-back-link svg {
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .cs-hero {
        min-height: auto;
        padding: 100px 20px 60px;
    }

    .cs-stats-bar {
        padding: 20px;
    }

    .cs-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cs-stat-number {
        font-size: 1.5rem;
    }

    .cs-section {
        padding: 60px 20px;
    }

    .cs-metrics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cs-features {
        grid-template-columns: 1fr;
    }

    .cs-gallery {
        grid-template-columns: 1fr;
    }

    .cs-cta {
        padding: 60px 20px;
        margin: 40px 20px;
    }

    .cs-cta-buttons {
        flex-direction: column;
    }

    .cs-cta-buttons .btn {
        width: 100%;
    }
}

/* Light Theme Adjustments */
html[data-theme="light"] .cs-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

html[data-theme="light"] .cs-stats-bar {
    background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .cs-section:nth-child(even) {
    background: #fafafa;
}

html[data-theme="light"] .cs-feature {
    background: white;
    border-color: #e2e8f0;
}

html[data-theme="light"] .cs-testimonial {
    background: linear-gradient(135deg, rgba(207, 91, 46, 0.08), rgba(244, 162, 97, 0.03));
}
