/*
filename: EcoFacts.css
author: Evan Lanza
student id last four: 8804
cs username: elanza05
*/

/* =========================================
   Eco FACT GENERATOR CONTAINER
   The main content area
   ========================================= */
#eco-facts-box {
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 550px;
    margin: 0 auto;
    padding: 20px;
    background-color:/*  #f4f9f2 */ #eef5ea;
    color: #1a3a16;
    border-radius: 25px;
    border: 10px solid #c0dd97;
    /* Ensures padding/border don't increase the width */
    box-sizing: border-box;
    position: relative;
    /* Flexbox used to stack elements vertically */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* GENERATOR HEADING */
#eco-facts-box h2 {
    margin-top: 10px;
    margin-bottom: 0;
    height: 40px;
    font-size: 2.5rem;
}

/* =========================================
   FACT DISPLAY AREA
   The middle section containing the
   arrows and the text content
   ========================================= */
.fact-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 280px;
    margin-top: 55px;
}

/* WRAPPER FOR THE FACT TEXT */
.text-container {
    flex: 1;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* INDIVIDUAL FACT TEXT STYLING */
#factText {
    font-size: 1.5rem;
    line-height: 1.5;
    /* Smooth transition for JavaScript-triggered changes */
    transition: opacity 0.5s ease;
    font-style: italic;
    margin: 0;
    color: #1a3a16;
}

/* =========================================
   NAVIGATION BUTTONS
   Styling for the left/right arrows
   ========================================= */
#eco-facts-box .nav-btn {
    background: none;
    border: none;
    font-size: 3.5rem;
    color: #678f62;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    /* Hidden by defualt */
    opacity: 0;
    /* Prevents text highlighting when clicking rapidly */
    user-select: none;
}

/* HOVER EFFECT TO REVEAL ARROWS */
#eco-facts-box:hover .nav-btn {
    opacity: 1;
}

/* HOVER EFFECT FOR ARROWS */
.nav-btn:hover {
    color: #1a3a16;
    transform: scale(1.2);
}

/* =========================================
   SOURCE LINK & BUTTON
   Positioned at the bottom of the card
   ========================================= */
#sourceLink {
    text-decoration: none;
    /* Sticks the link to the bottom */
    position: absolute;
    bottom: 30px;
    height: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* "VIEW SOURCE" BUTTON STYLING */
#sourceBtn {
    border-radius: 25px;
    padding: 10px 20px;
    width: 250px;
    font-size: 1.25rem;
    cursor: pointer;
    background-color: #c2deba;
    color: #1a3a16;
    border: 2px solid #1a3a16;
    transition: all 0.3s ease;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

/* HOVER EFFECT TO REVEAL SOURCE BUTTON */
#eco-facts-box:hover #sourceBtn {
    opacity: 1;
    visibility: visible;
}

/* HOVER EFFECT FOR SOURCE BUTTON */
#sourceBtn:hover {
    background-color: #678f62;
    color: #eef5ea;
}

/* =========================================
   ANIMATION CLASSES
   Toggled via JavaScript
   ========================================= */
.fade-out {
    opacity: 0;
}
