/* ---------------               Global background color            ---------------------*/
body {
    background-color: #ffffff; /* The "Dark Mode" background */
    color: #000000;            /* Light grey text for readability */
    margin: 0;
    padding: 0;
}





/* ---------------------         Coding the navigation bar         -----------------------*/

/* 
    This is the CSS for the container class of the navigation bar --
    make this a flex box so that everything on the navigation bar is horizontal
*/
.container {
    display: flex; 
    justify-content: space-between;
    align-items: center; 
}

/*
    This is the CSS for the navigation bar -- nav-links is the class for the 
    navigation links to the other pages
*/
.nav-links {
    display: flex;
    list-style: none;
    gap: 20px; 
    padding: 0;
    margin: 0;
}

/*
    Add colour to the navigation bar
*/
nav {
    background-color: #ffffff;
    padding: 10px 20px; 
}

/*
    Add colour to the navigation bar links
*/
.nav-links a {
    color: #000000;
    text-decoration: none;
}

/*
    Add colour to the navigation bar logo
*/

.logo img{
    height: 40px; 
    width: auto;
    display: block;
}

/*
    Underline the navigation bar links on hover
*/

.nav-links a:hover {
    text-decoration: underline; 
}

/*
    Add the subpages to Book Review.
*/
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 120px;
    box-shadow: 0px 8px 16px rgba(255, 255, 255, 0.2);
    z-index: 1;
    list-style: none;
}
.dropdown-content li a {
    color: rgb(0, 0, 0);
    padding: 8px 12px;
    display: block;
    text-decoration: none;
}
.dropdown:hover .dropdown-content {
    display: block;
}



/* ------ Coding the Interactive panda widget on index.html ------ */
.interactive-panda-container {
    position: relative;
    width: 320px;
    margin: 60px auto;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

#panda-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 20px auto;
}

#panda {
    width: 100%;
    height: 100%;
}

#panda-white-rectangle {
    position: absolute;
    width: 100px;
    height: 35px;
    right: 0;
    bottom: 0;
    background-color: white;
    z-index: 5;
    pointer-events: none;
}
#panda svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}


/* --- Floating Logic --- */
.bubbles-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 10; /* Ensures bubbles are on top */
}

.bubble {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* This creates the floating effect */
    animation: floatBubble 3s ease-in-out infinite;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Staggering the floating so they don't move in unison */
.bubble:nth-child(2) { animation-delay: 0.8s; }
.bubble:nth-child(3) { animation-delay: 1.6s; }

.bubble:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bubble a {
    text-decoration: none;
    color: #555;
    font-weight: bold;
}

@keyframes floatBubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* --- Fact State --- */


#fact-bubble {
    display: none;
    position: absolute;
    background-color: #f9f9f7;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    top: -20px;
    width: 90%;
    left: 5%;
    z-index: 20;
    cursor: pointer;
}

.dismiss-note {
    font-size: 10px;
    color: #aaa;
    display: block;
    margin-top: 5px;
}








/* ---------------          Coding the news article layout for lifepurpose      ------------------*/
/* Coding the position of title and the cards -- override the display: flex */
main.container {
    display: block;
    text-align: center;
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box; 
}


/* Coding the grid container */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 48%));
    gap: 20px;
    margin-top: 30px;
    justify-content: start;
}


/* Coding the individual cards */
.card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease; /* Add a smooth transition effect */
}

/* Targeting the headers in the cards to change their color */
.card h2 a {
    color: #2c3e50;
}

/* Hover effect of the headers */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #ffffff;    
}




/*----------------------- Coding the article layout for Life Lessons -----------------------*/
.article-page {
    display: block;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.article-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.article-content p{
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #333;
    text-align: justify;
    hyphens: auto;
}

.article-content ul {
    text-align: left;
    margin-left: 0;
    padding-left: 1.5rem;
}

.article-content h2, 
.article-content h3,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 40px;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    text-align: left;
    font-size: 1.5rem;
}

/* Styling the images */
.article-image {
    margin: 30px auto;
    max-width: 100%;
    text-align: center;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.article-image figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    line-height: 1.4;
    text-align: left;
    hyphens: auto;
}

