/* --- Basic Setup --- */
:root {
    --bg-color: #1a1a2e;
    --card-bg: #1f1f3a;
    --text-color: #e0e0e0;
    --header-color: #ffffff;
    --action-color: #43e97b;
    --border-color: rgba(255, 255, 255, 0.1);
    --secondary-text-color: rgba(224, 224, 224, 0.7);
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 1rem 1rem 4rem 1rem;
    line-height: 1.6;
}

/* --- Header --- */
.resource-header {
    text-align: center;
    max-width: 800px;
    margin: 1rem auto 4rem auto;
}
.back-link {
    display: inline-block;
    color: var(--header-color);
    text-decoration: none;
    font-weight: 700;
    margin-bottom: 2rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.back-link:hover { opacity: 1; }
h1 {
    color: var(--header-color);
    font-size: 2.5rem;
    margin: 0;
}
.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0.5rem auto 0 auto;
}

/* --- General Section Styling --- */
.resource-content {
    max-width: 800px;
    margin: 0 auto;
}
.section-title {
    color: var(--header-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--action-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}
.how-it-works-section, .science-section {
    margin-bottom: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- RESTORED: How It Works - Visual Steps --- */
.steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}
.step-item {
    flex: 1;
    text-align: center;
    padding: 0 1rem;
}
.step-number {
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--header-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
    border: 2px solid var(--action-color);
}
.step-item h3 {
    margin: 0 0 0.5rem 0;
    color: var(--header-color);
}
.step-connector {
    flex: 0 1 100px;
    height: 2px;
    background: var(--border-color);
    margin-top: 25px;
}


/* --- The Science Section --- */
.science-articles {
    display: grid;
    gap: 2.5rem; /* Increased spacing between cards */
    width: 100%;
}
.science-card {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.5s ease-out;
}
.card-content {
    padding: 2rem 2rem 1.5rem 2rem;
}
.card-content h3 {
    margin-top: 0;
    color: var(--header-color);
    font-size: 1.5rem;
}

/* --- REDESIGNED: Card Footer and Links --- */
.card-footer {
    padding: 1.5rem 2rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
    margin-top: auto; /* Pushes footer to the bottom */
}
.card-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
/* SECONDARY LINK: "Learn the Science" */
.source-link {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}
.source-link:hover {
    color: var(--text-color);
}
/* PRIMARY LINK: "Put it to Practice" */
.action-link {
    background: var(--action-color);
    color: #1a1a2e;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}
.action-link:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.2);
}

/* --- REDESIGNED: Share Section --- */
.share-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.share-section span {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    font-style: italic;
}
.share-button {
    background: rgba(255,255,255,0.1);
    color: var(--text-color);
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.share-button:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}
.share-button svg {
    stroke: var(--action-color);
    stroke-width: 3; /* Make icon thicker */
}

/* --- Highlight Effect (no change) --- */
.science-card.highlighted {
    border-color: var(--action-color);
    box-shadow: 0 0 30px rgba(67, 233, 123, 0.4);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    .step-connector {
        transform: rotate(90deg);
        width: 50px;
        margin: -10px 0;
    }
}
