/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #333333;
    /* Dark Gray */
    --secondary-color: #4054e7;
    /* Red */
    --accent-color: #c7dcff;
    /* Bright Blue */
    --background-color: #ffffff;
    /* White */
    --text-color: #2C3E50;
    /* Dark Blue */
    --hover-bg-color: #F0F0F0;
    /* Light Gray */
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Source Sans Pro', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header h1 {
    text-align: left;
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

header h1 span {
    color: var(--secondary-color);
}

/* Flex container for header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Centring the logo container. */
.logo-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1; /* Allow flexibility for centering */
}

.logo {
    max-width: 120px; /* Adjust size as needed */
    height: auto;
}

/* Responsive behavior */
@media (max-width: 768px) {
    header {
        flex-direction: column;
    }

    .logo-container {
        justify-content: center;
        padding-top: 10px;
    }
}


/* Chart Types Section */
.chart-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Chart Category */
.chart-category {
    background-color: var(--hover-bg-color);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    position: relative;
    /* For positioning description window if needed */
}

.chart-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chart-category h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
    position: relative;
}

/* Tooltip text */
.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
    border-radius: var(--border-radius);
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    /* Position the tooltip above the text */
    left: 50%;
    margin-left: -110px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.6em;
    line-height: 1.4;
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    /* Bottom of the tooltip */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

/* Show the tooltip text when hovering */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.chart-category ul {
    list-style-type: none;
    padding: 0;
}

.chart-category li {
    background: #ffffff;
    margin: 5px 0;
    padding: 8px 10px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
    border: 1px solid var(--hover-bg-color);
}

.chart-category li:hover {
    background: var(--accent-color);
    color: #ffffff;
}

/* Description Window */
.description-window {
    position: absolute;
    background-color: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--hover-bg-color);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    font-size: 0.9em;
    z-index: 1000;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    /* Prevents the description window from blocking other interactions */
}

.description-window.hidden {
    display: none;
}

.description-window.visible {
    display: block;
    pointer-events: auto;
    /* Allows interaction when visible */
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: #4054e7; /* Existing background color */
    color: #dddddd; /* Change this to your desired text color */
    border-radius: var(--border-radius);
}
footer p {
    font-size: 1em;
}
/* Footer link styles */
footer a {
    color: #ffffff; /* Ensure the link color stands out */
    text-decoration: underline; /* Optional: underline the link */
    transition: color 0.3s ease-in-out; /* Smooth transition */
}
footer a:hover {
    color: var(--accent-color); /* Change color on hover */
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-types {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2em;
    }

    .chart-category h2 {
        font-size: 1.4em;
    }

    .description-window {
        max-width: 90%;
        left: 5%;
        right: 5%;
    }
}

/* Chart Item */
.chart-item {
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    align-items: center; /* Center horizontally */
    justify-content: center; /* Center vertically */
    text-align: center; /* Ensure text is centered */
    padding: 15px;
    border: 1px solid var(--hover-bg-color);
    border-radius: var(--border-radius);
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
    cursor: pointer;
}
.chart-image {
    display: none; /* Initially hide the images */
    max-width: 100%; /* Make sure images are responsive */
    margin-top: 10px; /* Add space between the title and image */
    border-radius: var(--border-radius); /* Optional: match border-radius */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional: add a slight shadow */
}
.chart-description {
    display: none;
    padding-top: 10px; /* Space between image and description */
    font-size: 0.9em;
    color: var(--text-color);
}

.chart-description {
    display: none;
    padding-top: 10px; /* Space between image and description */
    font-size: 0.9em;
    color: var(--text-color);
}

/* Legend styles */
.chart-legends {
    display: none; /* Initially hidden */
    margin-top: 0px; /* Space between description and legends */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.chart-legend {
    display: flex;
    align-items: center;
    margin-bottom: 5px; /* Space between multiple legends */
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-description {
    font-size: 0.9em;
    color: var(--text-color);
}

.tooltip + .subtitle {
    font-size: 0.9em; /* Adjust font size */
    color: var(--text-color); /* Use a variable for text color */
    margin-top: 5px; /* Space between h2 and the subtitle */
    margin-bottom: 10px; /* Space between subtitle and the list */
    text-align: center; /* Center align the text */
}

/* General styles for larger screens */
header h1 {
    text-align: left;
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 20px;
    flex: 1;
}

header h1 span {
    color: var(--secondary-color);
}

/* Flex container for header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Centering the logo container */
.logo-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 175px;
    height: auto;
}

.logo {
    width: 100%; /* Ensure it scales within the container */
    max-width: 175px; /* Increase the size from previous settings */
    height: auto; /* Maintain aspect ratio */
}

/* Responsive behavior for smaller screens */
@media (max-width: 768px) {
    header {
        flex-direction: column;
    }

    header h1 {
        text-align: center; /* Center align the title */
    }

    .logo-container {
        justify-content: center;
        padding-top: 10px;
    }
}



/* Chat button styling */
.chat-btn {
    position: fixed;
    bottom: 40px;
    right: 20px;
    background-color: #4054e7;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
}

/* Chat popup styling */
.chat-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    border: 1px solid #4054e7;
    border-radius: 10px;
    width: 300px;
    background-color: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.chat-popup textarea {
    width: 100%;
    height: 60px;
    padding: 10px;
    border: none;
    border-radius: 2px;
    resize: none;
}

.chat-popup .chat-messages {
    height: 300px;
    overflow-y: scroll;
    padding: 10px;
    border-bottom: 1px solid #4054e7;
}

.chat-popup button {
    background-color: #4054e7;
    color: white;
    border: none;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 2px;
}

/* Legends Section */
.legend-section {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--hover-bg-color);
    border-radius: var(--border-radius);
}

.legend-section h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.legends {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 10px;
    cursor: pointer; /* Makes the legends appear clickable */
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.legend-item:hover {
    background-color: var(--accent-color);
    color: #ffffff;
    border-radius: var(--border-radius);
}

.legend-item.active {
    background-color: var(--accent-color);
    color: #ffffff;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-description {
    font-size: 1em;
    color: var(--text-color);
}