body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background: #005a9c; /* Azul CODIGA */
    color: #fff;
    padding: 1rem 0;
    text-align: center;
}

header #logo {
    width: 80px;
    margin-bottom: 0.5rem;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}
header h2 {
    margin: 0.2rem 0 0;
    font-size: 1.2rem;
    font-weight: normal;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

#intro #book-cover {
    display: block;
    max-width: 300px; /* Adjust size as needed */
    height: auto;
    margin: 0 auto 20px; /* Center the image */
    border: 1px solid #ddd;
    padding: 5px;
    background-color: #fff;
}


#intro ul {
    list-style: disc;
    padding-left: 20px;
}
#intro li {
    margin-bottom: 0.5rem;
}

.button, .nav-button {
    display: inline-block;
    background: #ff7f00; /* Naranja CODIGA - Default */
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}
.button:hover, .nav-button:hover {
    background: #e67300;
}

/* Specific color for the Next/Submit button */
.button.next-button,
.button.submit-button {
    background: #28a745; /* Green */
}
.button.next-button:hover,
.button.submit-button:hover {
    background: #218838; /* Darker green on hover */
}


/* Styles for the questionnaire blocks */
#quiz-container fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 30px; /* More space between blocks */
    border-radius: 5px;
}
#quiz-container legend {
    font-weight: bold;
    color: #005a9c;
    padding: 0 10px;
    font-size: 1.3em;
    margin-bottom: 15px; /* Space after legend */
}
#quiz-container .question {
    margin-bottom: 20px; /* More space between questions within a block */
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee; /* Separator between questions */
}
#quiz-container .question:last-child {
    border-bottom: none; /* No separator after last question in block */
    margin-bottom: 0;
    padding-bottom: 0;
}
#quiz-container .question p {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05em;
}
#quiz-container .question label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}
#quiz-container .question input[type="radio"] {
    margin-right: 8px;
}


#progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 5px;
}
#progress-bar {
    width: 0%;
    height: 20px;
    background-color: #ff7f00;
    border-radius: 5px;
    text-align: center;
    line-height: 20px;
    color: white;
    transition: width 0.3s ease-in-out;
}
#progress-text {
    text-align: center;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 20px;
}

/* Centering navigation buttons */
#navigation-buttons {
    display: flex;
    justify-content: center; /* Center the buttons */
    margin-top: 20px;
}
#navigation-buttons .button,
#navigation-buttons .nav-button {
     margin: 0 10px; /* Add spacing between buttons */
}


/* Results Page Layout */
#block-summary-table {
    margin-bottom: 30px;
}

#block-charts-container {
    margin-bottom: 30px;
}

#grouped-detailed-results {
    margin-bottom: 30px;
}

#final-summary {
    margin-bottom: 30px;
}


/* Results - Individual Question Items */
.result-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}
.result-item p {
    margin: 5px 0;
}
.valuation-icon {
    font-size: 1.2em;
    margin-right: 5px;
}
/* Status colors for individual MC question results */
.status-correct { color: green; }
.status-incorrect { color: red; }


.result-item .question-text {
    font-weight: bold;
}
.result-item .user-answer {
    font-style: italic;
    color: #555;
}
.result-item .advice {
    margin-top: 8px;
    background-color: #f9f9f9;
    padding: 8px;
    border-left: 3px solid #005a9c;
    font-size: 0.95em;
}
.result-item .chapter-ref {
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
}

/* Styles for grouped results blocks */
.block-results {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.block-results h3 {
    color: #005a9c;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

/* Styles for block summary within detailed results (like a header for the block) */
.block-summary-item {
    margin-bottom: 15px;
    font-size: 1.1em;
    padding: 10px;
    border-radius: 4px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
}

/* Status colors for Block Summary (in table and within detailed results) */
.block-summary-item.status-adecuado,
#block-summary-table .status-adecuado {
     color: green;
}
.block-summary-item.status-necesita-atencion,
#block-summary-table .status-necesita-atencion {
     color: orange;
}
.block-summary-item.status-prioritario,
#block-summary-table .status-prioritario {
     color: red;
}


/* Block Summary Table */
#block-summary-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}
#block-summary-table th, #block-summary-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
#block-summary-table th {
    background-color: #f0f0f0;
}

/* Styles for the Bar Charts */
#charts-area {
    margin-top: 20px;
}

.chart-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.chart-label {
    width: 200px; /* Fixed width for labels */
    flex-shrink: 0;
    margin-right: 10px;
    font-weight: bold;
    text-align: right;
}

.chart-bar-container {
    flex-grow: 1;
    background-color: #eee;
    height: 25px;
    border-radius: 3px;
    position: relative;
}

.chart-bar {
    height: 100%;
    border-radius: 3px;
    text-align: center;
    line-height: 25px;
    color: white;
    font-weight: bold;
    transition: width 0.5s ease-in-out;
}

/* Bar colors based on block percentage */
.chart-bar.bar-red { background-color: red; }
.chart-bar.bar-orange { background-color: orange; }
.chart-bar.bar-green { background-color: green; }

.chart-legend {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}
.legend-item {
    margin: 0 10px;
}


#final-summary #key-suggestions ul {
    list-style-type: disc;
    padding-left: 20px;
}

/* Botones Sociales */
#sharing {
    margin-top: 30px;
    text-align: center;
}
.social-button {
    display: inline-block;
    margin: 5px;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
}
.social-button i {
    margin-right: 8px;
}
.facebook { background-color: #3b5998; }
.twitter { background-color: #1da1f2; }
.whatsapp { background-color: #25d366; }


footer {
    text-align: center;
    padding: 1rem;
    background: #333;
    color: #fff;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    header h1 {
        font-size: 1.5rem;
    }
    header h2 {
        font-size: 1rem;
    }
    .button, .nav-button {
        font-size: 0.9rem;
        padding: 8px 15px;
    }
    #quizForm legend {
        font-size: 1.1em;
    }
     #quiz-container .question p {
        font-size: 1em;
     }
     .chart-label {
        width: 120px; /* Adjust width for smaller screens */
        text-align: left;
     }
}