/* Light/Dark Styles */

:root {
    --primary-bg: #1e1e1e; /* Dark background */
    --secondary-bg: #2d2d2d; /* Slightly lighter section */
    --highlight: #9b4df2; /* Vibrant purple */
    --notsovibrant: #aa7cde; /* not so vibrant purple */
    --accent: #4df2d3; /* Teal accent */
    --text-light: #f5f5f5; /* Light text */
    --text-muted: #b5b5b5; /* Muted text */
    --card-bg: linear-gradient(135deg, var(--accent), var(--highlight));
    --pw-style-0: #2c2c2e; /* Dark gray */
    --pw-style-1: #1e3f3f; /* Dark teal */
    --pw-style-2: #3e2f1f; /* Dark yellow */
    --pw-style-3: #3f1e3f; /* Dark purple */
}

:root.light-mode {
    --primary-bg: #f5f5f5; /* Light background */
    --secondary-bg: #ffffff; /* Slightly lighter section */
    --highlight: #9b4df2; /* Vibrant purple */
    --notsovibrant: #aa7cde; /* not so vibrant purple */
    --accent: #008080; /* Teal accent */
    --text-light: #000000; /* Dark text for readability */
    --text-muted: #757575; /* Muted text color */
    --card-bg: linear-gradient(135deg, var(--accent), var(--highlight));
    --pw-style-0: #f8f9fa; /* Light gray */
    --pw-style-1: #eaf7f7; /* Light teal */
    --pw-style-2: #fef7e6; /* Light yellow */
    --pw-style-3: #f7eaf7; /* Light purple */
}

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: var(--transition);
}

.header {
    margin-top: 50px; /* Creates a gap of 60px from the top menu */
    height: 30px; /* Set the height of the header */
    background-color: var(--secondary-bg); /* Slightly lighter background */
    width: 100%; /* Full-width */
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* Optional shadow for depth */
    z-index: 999; /* Ensure it's above other elements */
    position: relative; /* Positioned relative to the page flow */
}

/* Container */
.container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    gap: 20px; /* Space between content and sidebar */
    flex-wrap: wrap; /* Ensure wrapping on smaller screens */
}

/* Left Column: Content */
.content {
    flex: 3;
    padding: 20px;
    background: var(--secondary-bg); /* Slightly lighter background */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow */
}

/* Right Column: Sidebar */
.sidebar {
    flex: 1;
    padding: 20px;
    background: var(--secondary-bg); /* Slightly lighter background */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Consistent shadow */
}

/* Top Menu Bar */
.top-menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--secondary-bg); /* Slightly lighter background */
    border-bottom: 1px solid var(--primary-bg);
    z-index: 1000;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.menu-left .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--highlight); /* Violet for the logo text */
}


.menu-center {
    flex: 1;
    text-align: center;
    padding: 10px;
}

.motivational-quote {
    font-style: italic;
    font-size: 12px;
    color: var(--text-light);
    max-width: 80%;
    margin: 0 auto;
    display: block;
    line-height: 1.6;
}

.menu-center span {
    font-style: italic;
    font-size: 1rem;
    color: var(--text-light);
}

.menu-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-item {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background-color: var(--highlight); /* Violet background */
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px; /* Space between circle and text */
}

.profile-icon:hover {
    background-color: var(--notsovibrant); /* Teal highlight on hover */
}

.profile-text {
    font-size: 10px;
    font-weight: none;
    text-align: center;
}


/* Module Containers */
.module-container {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 10px;
    background: var(--primary-bg); /* Darker background */
    border-left: 5px solid var(--highlight); /* Highlight border for modules */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Article Titles */
.article h3 {
    font-size: 1.5rem;
    color: var(--notsovibrant); /* Violet */
    margin-bottom: 10px;
}

/* Article Preview */
.preview-content {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-muted);
}

/* Read More Button */
.button {
    color: var(--text-light);
    background-color: var(--notsovibrant); /* Violet for action buttons */
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.button:hover {
    background-color: var(--highlight); /* Violet on hover */
    transform: translateY(-2px);
}

.button:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

/* Leaderboard Container */
.leaderboard-title {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-muted); /* Muted text */
}

.leaderboard {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 600px;
    background: var(--primary-bg); /* Primary background */
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: var(--text-light); /* Light text */
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--secondary-bg); /* Secondary background */
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

/*.leaderboard-item:hover {
    transform: scale(1.03);
    background: var(--accent); /* Teal on hover 
} */

/* Adjust Rank Styling */
.leaderboard-item .rank {
    font-size: 1rem;
    color: var(--text-light); /* Highlight for rank */
    font-weight: bold;
    margin-right: 10px;
    display: flex;
    align-items: center;
}

/* Footer */
footer {
    background-color: var(--primary-bg); /* Primary background */
    color: var(--text-muted); /* Muted text */
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}


footer a {
    color: var(--text-light); /* Light text */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--highlight); /* Highlight on hover */
}

/* Adjust Flag Styling */
.leaderboard-item .flag img {
    width: 20px; /* Slightly larger for visibility */
    height: 10px; /* Maintain aspect ratio */
    border-radius: 3px; /* Smooth corners */
    margin-right: 10px; /* Add spacing after the flag */
    border: 1px solid #ddd; /* Optional: Add a subtle border */
}

/* Adjust Username and Points */
.leaderboard-item .username {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--notsovibrant);
}

.leaderboard-item .points {
    font-size: 1rem;
    font-weight: none;
    color: var(--text-light); /* Violet for points */
    margin-left: auto; /* Push points to the right */
    text-align: right; /* Align points neatly */
}

/* Badge Styling */
.badge.gold {
    color: #ffd700; /* Gold */
}

.badge.silver {
    color: #c0c0c0; /* Silver */
}

.badge.bronze {
    color: #cd7f32; /* Bronze */
}

/* Interactive Section Header */
.interactive-section h2 {
    font-size: 1.5rem;
    color: var(--notsovibrant);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--notsovibrant);
    padding-bottom: 5px;
}


/* Pathway Styles */
.pathway {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pathway:hover {
    transform: scale(1.02);
}

/* Different Background Colors for Each Pathway */
.pathway-style-0 {
    background-color: var(--pw-style-0); /* Light gray */
}

.pathway-style-1 {
    background-color: var(--pw-style-1); /* Teal tint */
}

.pathway-style-2 {
    background-color: var(--pw-style-2) /* Yellow tint */
}

.pathway-style-3 {
    background-color: var(--pw-style-3); /* Purple tint */
}

/* Pathway Title Button */
.pathway-title {
    background-color: var(--notsovibrant); /* Violet */
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border-bottom: 2px solid var(--notsovibrant);
}

.pathway-title:hover {
    background-color: var(--highlight);
    transform: translateY(-2px);
}

.pathway-title:disabled {
    background-color: #ddd;
    cursor: not-allowed;
}

/* Quiz Container */
.quiz-container {
    background-color: var(--primary-bg);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

/* Question Styles */
.quiz-question {
    margin-bottom: 20px;
}

.quiz-question p {
    font-weight: bold;
}

.quiz-question label {
    display: block;
    margin-bottom: 5px;
}

/* Submit Button */
.quiz-form button {
    background-color: var(--notsovibrant);
    color:  var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.quiz-form button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Interactive Quiz Title Button */
.interactivequiz-title {
    background-color: var(--notsovibrant); /* Violet */
    color:  var(--text-light);
    border: none;
    padding: 10px 15px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#topic {
    resize: none;
    width: 100%;
    height: 100px;
}

.logout-button {
        padding: 10px 20px;
        background-color: var(--highlight); /* Button background color */
        color: var(--text-light); /* Button text color */
        border-radius: 5px; /* Rounded corners */
        cursor: pointer;
        font-weight: none;
        text-decoration: none;
        transition: background-color 0.3s ease, color 0.3s ease;
        }

        .logout-button:hover {
            background-color: var(--accent); /* Darker shade for hover effect */
        }

        .toggle-button {
        color: var(--text-light);
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-weight: none;
        transition: background-color 0.3s ease, color 0.3s ease;
        display: flex;
        align-items: center;
        gap: 10px; /* Space between icon and text */
        }

        .toggle-button:hover {
        background-color: var(--notsovibrant);
        }

        #toggleIcon {
        font-size: 1.2rem; /* Icon size */
        }

        .reward {
            display: inline-block;
            padding: 5px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
            color: var(--text-light);
            background-color: #71d187;
        }

        .cost {
            display: inline-block;
            padding: 5px 10px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
            color: var(--text-light);
            background-color: #fcb05d;
        }

/* Additional Improvements */

/* Ensure tables and forms are scrollable on smaller devices */
table, form {
    width: 100%;
    overflow-x: auto;
}

/* Smooth transitions for hover effects on mobile */
.module-container:hover, .quiz-button:hover, .button:hover {
    transform: none; /* Remove hover transformations for better mobile UX */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* Maintain subtle hover shadow */
}

/* Ensure images do not exceed their containers */
img {
    max-width: 100%;
    height: auto;
}

/* Centered Message Styling */
.centered-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    padding: 20px 30px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slide-in 0.5s ease;
    color: #fff;
    background-color: #71d187; /* Default success background */
}

.centered-message.error {
    background-color: #f44336; /* Error background */
}

.fade-out {
    animation: fade-out 1s ease;
    opacity: 0;
}

/* Poll Module Styling */
.poll-container {
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
    max-width: 350px; /* Keep it compact */
    margin: 20px auto;
    border-left: 5px solid var(--highlight);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poll-container:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Poll Title */
.poll-container h3 {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--notsovibrant);
    margin-bottom: 15px;
}

/* Poll Description */
.poll-container p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Poll Options */
.poll-options label {
    display: block;
    background: var(--primary-bg);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
    font-weight: none;
    color: var(--text-light);
    text-align: left;
    border-radius: 3px; /* Smooth corners */
    border: 1px solid  var(--text-muted); /* Optional: Add a subtle border */
}

.poll-options label:hover {
    background: var(--notsovibrant);
    color: var(--text-light);
    transform: translateY(-2px);
}

/* Radio Button Styling */
.poll-options input[type="radio"] {
    display: none;
}

.poll-options input[type="radio"]:checked + label {
    background: var(--accent);
    color: #fff;
    transform: scale(1.05);
}

/* Submit Button */
.poll-container button {
    background: var(--highlight);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.poll-container button:hover {
    background: var(--notsovibrant);
    transform: translateY(-2px);
}

/* Live Poll Results */
.poll-results {
    margin-top: 20px;
}

.poll-results h4 {
    font-size: 1.2rem;
    color: var(--notsovibrant);
    margin-bottom: 10px;
    color: var(--text-muted);
}

/* Ensure progress bars look good */
.poll-result-item {
    padding: 5px 5px;
    border-radius: 1px;
    background-color: var(--notsovibrant);
}

/* Progress Bar Styling */
.progress-bar {
    background: var(--primary-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    height: 25px;
    display: flex;
    align-items: center;
    padding: 5px;
}

.progress {
    height: 25px;
    text-align: left;
    color: var(--text-light);
    font-weight: none;
    border-radius: 5px;
    transition: width 1s ease-in-out;
}

/* Dynamic Colors for Progress Bars */
.progress.option1 { background-color: var(--pw-style-1) } 
.progress.option2 { background-color: var(--pw-style-2); } 
.progress.option3 { background-color: var(--pw-style-3); } 

    .tooltip-container {
        position: relative;
        display: inline-block;
        cursor: pointer;
        margin-left: 10px;
    }

    .tooltip-icon {
        display: inline-block;
        width: 20px;
        height: 20px;
        background-color: #007bff;
        color: #fff;
        text-align: center;
        border-radius: 50%;
        font-size: 14px;
        line-height: 20px;
        font-weight: bold;
    }

    .tooltip-content {
        display: none;
        position: absolute;
        top: 30px;
        left: 50%;
        transform: translateX(-50%);
        background-color: var(--secondary-bg);
        color: var(--text-light);
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        width: 200px;
        text-align: left;
        font-size: 10px;
        font-weight: none;
    }

    .tooltip-container:hover .tooltip-content {
        display: block;
    }

    .tooltip-content::before {
        content: '';
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #ccc transparent;
    }


/* Slide-in animation */
@keyframes slide-in {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Fade-out animation */
@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive Design */

* Medium devices (tablets, 768px and below) */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* Stack the columns vertically */
        gap: 15px;
    }

    .content, .sidebar {
        flex: 1;
        margin: 0;
        max-width: 100%; /* Allow full width */
    }

    .top-menu-bar {
        position: static;
    }

    .module-container {
        padding: 15px;
    }

    .button {
        font-size: 14px;
        padding: 8px 15px;
    }

    .motivational-quote {
    font-size: 12px;
    max-width: 90%;
    }
}
/* Small devices (phones, 480px and below) */
@media (max-width: 480px) {
    .header {
        padding: 15px;
        font-size: 16px;
        text-align: center; /* Center align for better presentation */
    }

    .content, .sidebar {
        padding: 15px;
        margin: 0; /* Remove margin for better fit */
    }

    .button {
        font-size: 12px;
        padding: 6px 10px;
    }

    .section h2, .gamification h3 {
        font-size: 14px;
    }

    .leaderboard-item {
        flex-direction: column; /* Stack items vertically */
        align-items: flex-start;
    }

    .profile-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .tarot-result img {
        max-width: 100%; /* Ensure full width on smaller screens */
    }

    .interactive-section {
        padding: 15px; /* Adjust padding for better spacing */
    }

    .quiz-button {
        font-size: 12px; /* Reduce font size for smaller buttons */
    }

    .motivational-quote {
        display: none;
    }
}
