/* ====================================
   CASE STUDY PAGE STYLES
   For work/project showcase pages
   ==================================== */

/* Back to Projects Link */
.back-link-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--pink);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--purple);
    transform: translateX(-5px);
}

.grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../images/grid.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: -3;
}

/* Hero Section */
.case-study-hero {
    padding: 3rem 2rem 5rem;
    margin: 0 auto;
    position: relative;
    z-index: 1; /* Lower than nav */
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: var(--big-text-glow);
}

.hero-text h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--pink);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.hero-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text);
}

.hero-image img {
    width: 100%;
    height: auto;
}

/* Case Study Sections */
.case-study-section {
    padding: 4rem 2rem;
    margin: 0 auto;
    position: relative; /* ADDED - needed for z-index */
    z-index: 1; /* ADDED - lower than nav */
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* ADDED - needed for proper stacking */
}

.case-study-section h2 {
    font-family: var(--header-font-family);
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: var(--small-text-glow);
}

.case-study-section p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Two Column Layouts */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative; /* ADDED */
}

.two-column.reverse {
    direction: rtl;
}

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

.text-column {
    padding: 1rem 0;
    position: relative; /* ADDED */
}

.image-column {
    position: relative; /* ADDED */
}

.image-column img {
    width: 100%;
    height: auto;
}

/* Centered Content Sections */
.section-content.centered {
    text-align: center;
}

.section-content.centered p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Challenge Section */
.challenge-list {
    list-style: none;
    padding: 0;
    margin: 2rem auto;
    max-width: 800px;
}

.challenge-list li {
    font-size: 1.2rem;
    padding: 1rem 0;
    padding-left: 2rem;
    position: relative;
}

.challenge-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--pink);
    font-weight: bold;
    font-size: 1.5rem;
}

/* Split Image Display */
.split-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    position: relative; /* ADDED */
}

.split-image-half {
    position: relative;
}

.split-image-half img {
    width: 100%;
    height: auto;
}

.image-label {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--pink);
}

.image-label.blue {
    color: var(--blue);
}

.image-label.red {
    color: var(--red);
}

/* Feature Grid (Design & Dev Section) */
.dev-section {
    background-color: rgba(252, 221, 12, 0.05);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    position: relative; /* ADDED */
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    position: relative; /* ADDED */
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    margin-bottom: 1rem;
}

.feature-icon svg {
    color: var(--pink);
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

/* Device Mockups */
.device-mockups {
    margin-top: 4rem;
    position: relative; /* ADDED */
}

.device-mockups img {
    width: 100%;
    height: auto;
}

/* Process Timeline Section */
.process-section {
    background-color: rgba(113, 0, 180, 0.05);
}

.process-intro {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 4rem 0;
    padding: 0 1rem;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.timeline-item {
    flex: 1;
    text-align: center;
    position: relative;
    min-width: 0;
}

.timeline-icon {
    width: 60px;
    height: 60px;
    background-color: var(--pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(249, 21, 133, 0.3);
    flex-shrink: 0;
}

.timeline-icon svg {
    color: white;
    width: 24px;
    height: 24px;
}

.timeline-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
    word-wrap: break-word;
}

.timeline-item p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--muted);
    margin: 0;
    word-wrap: break-word;
}

/* Timeline Connectors (lines between items) */
.timeline-connector {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 30px;
    max-width: 80px;
    height: 2px;
    background-color: var(--pink);
    align-self: flex-start;
    margin-top: 30px;
    opacity: 0.3;
}

/* Outcome Section */
.outcome-section {
    background-color: rgba(250, 0, 39, 0.05);
}

.testimonial-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 3rem auto;
    border-left: 4px solid var(--pink);
    position: relative; /* ADDED */
}

.testimonial-text {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 1rem;
}

.testimonial-attribution {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pink);
    margin: 0;
}

.outcome-closing {
    margin: 3rem auto 4rem;
}

.final-mockup {
    margin-top: 3rem;
    position: relative; /* ADDED */
}

.final-mockup img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Key Takeaways Section */
.takeaways-section {
    background-color: rgba(45, 185, 230, 0.05);
}

.takeaways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    position: relative; /* ADDED */
}

.takeaway-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: var(--transition);
    position: relative; /* ADDED */
}

.takeaway-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.takeaway-icon {
    margin-bottom: 1.5rem;
}

.takeaway-icon svg {
    color: var(--pink);
    width: 32px;
    height: 32px;
}

.takeaway-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text);
}

/* Final CTA Section */
.case-study-cta {
    padding: 2rem;
    text-align: center;
    margin: 0;
    position: relative; /* ADDED */
    z-index: 1; /* ADDED - lower than nav */
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative; /* ADDED */
}

.case-study-cta h2 {
    font-family: var(--header-font-family);
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: var(--big-text-glow);
    color: var(--text);
}

.case-study-cta p {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    color: var(--text);
}

/* ====================================
   RESPONSIVE DESIGN
   Mobile and Tablet Breakpoints
   ==================================== */

@media screen and (max-width: 1024px) {
    /* Tablet adjustments */
    .hero-content,
    .two-column {
        gap: 3rem;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .case-study-section h2 {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 768px) {
    /* Mobile Layout Changes */
    
    .back-link-container {
        padding: 1rem 1rem 0;
    }

    /* Hero Section */
    .case-study-hero {
        padding: 2rem 1rem 3rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
        text-align: center;
    }

    .hero-text h2 {
        font-size: 1.4rem;
        text-align: center;
    }

    .hero-text p {
        font-size: 1.1rem;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    /* All Sections */
    .case-study-section {
        padding: 3rem 1rem;
    }

    .case-study-section h2 {
        font-size: 2rem;
        text-align: center;
    }

    .case-study-section p {
        font-size: 1.1rem;
    }

    /* Two Column to Single Column */
    .two-column {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .two-column.reverse {
        direction: ltr;
    }

    /* Split Images Stack */
    .split-image {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Timeline - Vertical on Mobile */
    .timeline {
        flex-direction: column;
        padding: 0 1rem;
        gap: 2rem;
    }

    .timeline-connector {
        display: none;
    }

    .timeline-item {
        padding-bottom: 2rem;
        padding-left: 80px;
        text-align: left;
        position: relative;
        border-left: none;
    }

    /* Create vertical line connecting icons */
    .timeline-item:not(:last-child)::after {
        content: '';
        position: absolute;
        left: 30px;
        top: 70px;
        bottom: -2rem;
        width: 2px;
        background-color: var(--pink);
        opacity: 0.3;
    }

    .timeline-icon {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
    }

    /* Testimonial Card */
    .testimonial-card {
        padding: 2rem;
        margin: 2rem 1rem;
    }

    .testimonial-text {
        font-size: 1.1rem;
    }

    /* Takeaways Grid */
    .takeaways-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Final CTA */
    .case-study-cta {
        padding: 3rem 1.5rem;
    }

    .case-study-cta h2 {
        font-size: 2rem;
    }

    .case-study-cta p {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 420px) {
    /* Extra Small Mobile Adjustments */
    
    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text h2 {
        font-size: 1.2rem;
    }

    .case-study-section h2 {
        font-size: 1.8rem;
    }

    .case-study-section p,
    .hero-text p {
        font-size: 1rem;
    }

    .feature-card,
    .takeaway-card {
        padding: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }

    .case-study-cta h2 {
        font-size: 1.8rem;
    }
}