/*
 * case-studies.css
 * Styles specific to case-studies.html.
 * Relies on CSS custom properties defined in index.css (:root).
 */

/* =====================================================
   PAGE LAYOUT
   ===================================================== */

/*
 * The case-studies page sets its own body background and scrolling
 * via a scoped class to avoid !important overrides.
 */
body.case-studies-page {
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--brand);
    min-height: 100vh;
}

body.case-studies-page #particles-js {
    display: none;
}

.case-studies-wrapper {
    width: 90vw;
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 8vh 5vw;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* =====================================================
   BACK LINK
   ===================================================== */
.back-link {
    display: inline-block;
    margin: 20px 0;
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    transition: all 0.3s;
}

.back-link:hover {
    transform: translateX(-5px);
    opacity: 0.8;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    text-align: center;
    margin-bottom: 5vh;
}

.page-header h1 {
    font-size: 60px;
    color: #fff;
    text-decoration: underline;
    margin-bottom: 2vh;
}

.page-header p {
    font-size: 21px;
    opacity: 0.9;
    color: #fff;
}

/* =====================================================
   INTRO SECTION
   ===================================================== */
.intro-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 8vh;
}

.intro-section p {
    font-size: 18px;
    line-height: 1.8;
    color: #fff;
}

/* =====================================================
   WEB PROJECTS SECTION
   ===================================================== */
.web-projects-section {
    margin: 8vh 0;
    padding: 40px;
    border-radius: var(--radius-card);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.web-projects-section h2 {
    font-size: 40px;
    color: #fff;
    text-decoration: underline;
    margin-bottom: 10px;
}

.section-description {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
    color: #fff;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.project-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition);
    text-decoration: none;
    color: #fff;
    display: block;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(0, 0, 0, 0.5);
    border-color: #fff;
}

.project-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #fff;
}

.project-card p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 15px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.project-tag {
    font-size: 12px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.project-link-icon {
    font-size: 14px;
    opacity: 0.7;
    margin-left: 5px;
}

/* =====================================================
   CASE STUDY BLOCKS
   ===================================================== */
.case-study {
    border-radius: var(--radius-card);
    padding: 40px;
    margin: 8vh 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.case-study h2 {
    font-size: 40px;
    margin-bottom: 20px;
    color: #fff;
    text-decoration: underline;
}

.case-study h3 {
    font-size: 28px;
    margin: 30px 0 10px;
    color: #fff;
}

.case-study p {
    font-size: 18px;
    line-height: 1.8;
    margin: 15px 0;
    color: #fff;
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    display: block;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    color: #fff;
}

/* =====================================================
   CHARTS
   ===================================================== */
.comparison-note {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 10px 18px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #fff;
}

.comparison-note span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 10px 0 40px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* =====================================================
   METHODOLOGY BOX
   ===================================================== */
.methodology {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border-left: 2px solid #000;
    border-right: 2px solid #000;
}

.methodology h4 {
    margin-bottom: 15px;
    font-size: 21px;
}

.methodology ul {
    list-style-position: inside;
    opacity: 0.9;
}

.methodology li {
    margin: 10px 0;
    padding-left: 10px;
    font-size: 16px;
}

/* =====================================================
   RESPONSIVE — MOBILE
   ===================================================== */
@media (max-width: 800px) {
    .page-header h1 {
        font-size: 40px;
    }

    .case-study {
        padding: 25px;
    }

    .case-study h2 {
        font-size: 30px;
    }

    .case-study h3 {
        font-size: 22px;
    }

    .chart-container {
        height: 300px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .web-projects-section {
        padding: 25px;
    }

    .web-projects-section h2 {
        font-size: 30px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .comparison-note {
        font-size: 12px;
        gap: 12px;
    }
}
