/* ==============================
   Global Styles and Resets
============================== */

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

body {
    padding: 20px;
    max-width: 600px;
    margin: auto;
}

body.feedback-active {
    max-width: 1000px;
}

p, h1, h2, h3, h4, li {
    line-height: 1.5;
}

p {
    font-size: 16px;
    margin-bottom: 20px;
}

ul {
    list-style-type: square; /* Standard bullet points */
    margin: 10px 20px;
    padding-left: 20px; /* Space between bullet points and text */
}

li {
    font-size: 16px;
    margin-bottom: 5px;
}

/* ==============================
   Typography
============================== */

h1, h2, h3 {
    text-align: center;
    color: #000;
    font-weight: 500; /* Medium weight for headings */
}

h4 {
    font-size: 16px;
    color: #000;
    font-weight: 500; /* Medium weight for subheadings */
}

/* ==============================
   Page Structure
============================== */

.page {
    display: none;
    padding: 30px 20px;
    margin-bottom: 20px;
}

.page.active {
    display: block;
}

#questionnaire-page {
    text-align: center;
}

#questionnaire-page button {
    display: block;
    margin: 10px auto;
    padding: 10px 20px;
}

/* ==============================
   Progress Bar
============================== */

#question-number-container {
    position: relative;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

#question-number {
    padding: 10px 0;
}

#progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(200, 200, 200, 0.3); /* Light background */
    z-index: -1;
    border-radius: 0; /* Square corners */
}

#progress-bar {
    height: 100%;
    background-color: rgba(200, 200, 200, 0.7); /* Darker progress bar */
    width: 0%; /* Initial progress */
    border-radius: 0; /* Square corners */
    transition: width 0.3s ease; /* Smooth width transition */
}

/* ==============================
   Buttons
============================== */

button {
    display: block;
    width: 100%;
    max-width: 200px; /* Optional: limit button width */
    padding: 12px 20px;
    margin: 12px auto;
    font-size: 16px;
    cursor: pointer;
    background-color: rgba(200, 200, 200, 0.7);
    border: none;
    border-radius: 0; /* Square corners */
    color: #000;
    text-align: left;
    text-decoration: none;
    appearance: none; /* Remove default styling */
    outline: none; /* Remove focus outline */
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: rgba(200, 200, 200, 1);
}

/* ==============================
   Scores and Feedback Sections
============================== */

.score {
    margin-bottom: 10px;
    font-size: 18px;
}

.domain-container, .facet-container {
    margin-bottom: 50px; /* Space between sections */
}

.domain-header, .facet-header {
    padding: 10px;
    margin: 0;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.domain-header:hover, .facet-header:hover {
    background-color: rgba(0, 0, 0, 0.1); /* Slight darken on hover */
}

.domain-content, .facet-content {
    padding: 10px;
    margin: 0;
    font-size: 14px;
    border-top: none; /* Connects seamlessly with header */
}

/* ==============================
   Charts
============================== */

#domainRadarChart {
    z-index: -1;
    margin: -100px 0;
}

#domainBarChart,
#selfManagementChart,
#socialEngagementChart,
#cooperationChart,
#emotionalResilienceChart,
#innovationChart,
#compoundChart {
    margin-bottom: 20px;
}

#chart-toggle-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#chart-toggle-buttons button {
    margin: 0 12px;
    z-index: 1;
}

/* ==============================
   Side Navigation
============================== */

#side-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: #f4f4f4;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

#side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: #f4f4f4;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#side-nav h3 {
    margin: 20px;
}

#side-nav h3 a {
    text-decoration: none;
    color: #000;
    transition: color 0.3s ease;
}

#side-nav h3 a:hover {
    color: #007acc; /* Highlight color on hover */
}

#side-nav ul {
    list-style-type: none;
    margin: 20px;
    padding: 0;
}

#side-nav ul li {
    margin-bottom: 15px;
}

#side-nav ul li a {
    text-decoration: none;
    font-size: 16px;
    color: #000;
    transition: color 0.3s ease;
}

#side-nav ul li a:hover {
    color: #007acc; /* Highlight color on hover */
}

/* ==============================
   Feedback Content
============================== */

#feedback-content {
    margin-left: 220px; /* Space for side navigation */
    padding: 20px;
}

#domain-scores,
#facet-scores {
    margin: 20px 0;
}

/* ==============================
   Responsive Design
============================== */

/* For screens up to 960px wide */
@media (max-width: 960px) {
    /* Side Navigation */
    #side-nav-container {
        transform: translateX(-100%); /* Hide off-screen */
    }

    #side-nav-container.show {
        transform: translateX(0); /* Slide in when toggled */
        z-index: 1001; /* Bring to front when shown */
    }

    /* Menu Toggle Button */
    #menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1000; /* Below the side nav when shown */
    }

    /* Overlay */
    #menu-overlay {
        display: none; /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
        z-index: 1000; /* Below the side nav when shown */
    }

    /* Show overlay when menu is active */
    #side-nav-container.show + #menu-overlay {
        display: block;
    }

    /* Adjust feedback content for smaller screens */
    #feedback-content {
        margin-left: 0;
    }

    #domainRadarChart {
        margin: 0;
    }
}

/* Hide menu button on larger screens */
@media (min-width: 961px) {
    #menu-toggle {
        display: none;
    }
}

/* ==============================
   Print Styles
============================== */

@media print {
    /* Hide elements not needed in print */
    #menu-toggle,
    #side-nav-container,
    #menu-overlay,
    #chart-toggle-buttons {
        display: none;
    }

    /* Adjust feedback content for printing */
    #feedback-content {
        margin-left: 0;
    }

    /* Force page breaks before sections */
    #domain-feedback,
    #self-management,
    #social-engagement,
    #cooperation,
    #emotional-resilience,
    #innovation,
    #compound {
        page-break-before: always; /* For older browsers */
        break-before: page;        /* For modern browsers */
    }

    /* Set margins for printed pages */
    @page {
        margin-top: 20mm;
        margin-bottom: 20mm;
    }

    /* Remove margins and padding from body */
    body {
        margin: 0;
        padding: 0;
    }

    /* Ensure body and html use full height */
    html, body {
        height: auto;
    }

    /* Set box-sizing to border-box */
    *, *::before, *::after {
        box-sizing: border-box;
    }
}
