/* ==================== */
/* Basic Reset */
/* ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== */
/* Body and General Styles */
/* ==================== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #ECEFF1; /* Light grey */
    color: #212121; /* Dark grey */
    line-height: 1.6;
    padding: 0;
    overflow: hidden;
    position: relative;
    overflow-x: hidden;
    height: 100%;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #FFFFFF; /* White */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding-top: 10px;
    padding-bottom: 10px;
    overflow-x: hidden;
}



/* ==================== */
/* Typography */
/* ==================== */
h1, h2, h3, h5, h6 {
    color: #0D47A1; /* Dark blue */
}

h4 {
    text-align: center;
    margin-bottom: 20px;
    color: #3b4a6b;
}

.center-paragraph {
    text-align: center;
}

.center-paragraph-bold {
    text-align: center;
    font-weight: bold;
}

.justify-paragraph {
    text-align: justify;
}

.link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #1E88E5; /* Medium blue */
    text-decoration: none;
    transition: color 0.3s;
}

.link:hover {
    color: #1565C0; /* Darker blue */
}

/* ==================== */
/* Buttons */
/* ==================== */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    margin-right: 8px;
}

.btn-circle {
    display: inline-block;
    color: #ffffff;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-circle.red {
    background-color: #667188;
}

.btn-circle.red:hover {
    background-color: #424e68;
}

.btn-circle.green {
    background-color: #004fa3;
}

.btn-circle.green:hover {
    background-color: #004288;
}

.btn-circle i {
    margin: 0;
}

.centered-view {
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overflow-x: hidden;
    margin-top: 15px;
    height: calc(100vh - 80px); 
}

.card {
    border-radius: 8px;
    margin: 8px;
    width: calc(100% - 16px);
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: #fff;
    position: relative;
    z-index: 100; /* Lower than navbar */
    margin-top: 15px;
}



.card-header {
    padding: 12px 15px;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.card-body {
   overflow-y: hidden;
}

.submit-btn {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 12px 24px;
    background: #3b4a6b;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.submit-btn:hover {
    background: #2c3a56;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.submit-btn:active {
    transform: translateY(0);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-icon {
    width: 35px;
    height: 35px;
    background-color: #3b4a6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.power-btn {
    background: none;
    border: none;
    color: #3b4a6b;
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.power-btn:hover {
    color: #dc3545;
}

.terms-content {
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
}

.terms-content::-webkit-scrollbar {
    width: 30px;
}

.terms-content::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.terms-content::-webkit-scrollbar-thumb {
    background-color: #6c757d;
    border-radius: 4px;
}

.text-justify {
    text-align: justify;
}

.center-content{
    height: 70vh; 
    overflow-y: hidden; 
    padding: 20px; 
    margin-bottom: 30px;
}

.center-content-questions {
    width: 100%;
    padding: 5px;
    margin: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    height: calc(100vh - 160px); /* Ajustado para considerar header y footer */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}


/* ==================== */
/* Forms */
/* ==================== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-group {
    position: relative;
    margin-bottom: 20px;
    flex: 1 1 calc(50% - 20px); /* Flexible width for two columns */
    max-width: calc(50% - 20px); /* Limit width to fit two columns */
}

.form-group.full-width {
    flex: 1 1 100%; /* Full width for single-column fields */
    max-width: 98%;
}

.form-group label {
    font-size: 14px;
    color: #3b4a6b; /* Dark blue-gray for labels */
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px 12px 40px; /* Extra padding for icon */
    border: 1px solid #d6dde5; /* Light gray-blue border */
    border-radius: 4px;
    background: #f8fafc; /* Light gray-blue input background */
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b4a6b; /* Dark blue-gray on focus */
    background: #ffffff;
}

.form-group input.read-only,
.form-group textarea.read-only,
.form-group select.read-only {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.form-group input.editable,
.form-group textarea.editable,
.form-group select.editable {
    background-color: #eaf4ff;
    border-color: #0056b3;
}

.form-group i {
    position: absolute;
    left: 10px;
    top: 60%;
    transform: translateY(-50%);
    color: #9aa8bd; /* Light gray-blue for icons */
    font-size: 16px;
    pointer-events: none;
}

textarea {
    resize: none;
    height: 100px;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.checkbox-group .option,
.radio-group .option {
    flex: 1 1 calc(50% - 20px); /* Divide into two columns */
    max-width: calc(50% - 20px);
}

.checkbox-group label,
.radio-group label {
    font-size: 14px;
    color: #3b4a6b; /* Dark blue-gray for labels */
    cursor: pointer;
    display: flex;
    align-items: center;
}

.checkbox-group input,
.radio-group input {
    margin-right: 10px;
}

/* ==================== */
/* Error Messages */
/* ==================== */
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.error-row {
    grid-column: 1 / -1;
    padding: 8px 12px;
    background-color: #fff3f3;
    border-radius: 4px;
    margin: 4px 0;
}

/* ==================== */
/* Survey Table */
/* ==================== */
.survey-table {
    width: 100%;
    border-collapse: collapse;
    overflow-y: auto;
    max-height: 360px;
    display: table;
    padding: 5px 0;
    margin-bottom: 15px;
    table-layout: fixed;

}

.table-header {
    display: grid;
    position: sticky;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(100px, 1fr));
    min-width: max-content;
    top: 0;
    z-index: 100;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(100px, 2fr) repeat(auto-fit, minmax(100px, 1fr));
    min-width: max-content;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.table-row.even {
    background-color: #f8f9fa;
}

.question-col {
    padding: 0 0 15px 0;
    margin-bottom: 15px;
    font-size: 15px;
    max-width: 600px;
}

.options-col {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    min-width: auto;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 5px 0;
    padding: 10px;
    transition: background-color 0.2s ease;
}

.question-number {
    font-weight: bold;
    color: #3b4a6b;
}

.options-col {
    justify-content: center;
}

body[data-route*="personalidad"] .table-row {
    min-width: 300px;
    word-wrap: break-word;
    white-space: normal;
}

.section-center{
    padding-top: 150px;
}


/* ==================== */
/* Custom Radio Button */
/* ==================== */
.custom-radio {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d6dde5;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
}

.custom-radio:checked {
    border-color: #0D47A1;
    background-color: #0D47A1;
    box-shadow: inset 0 0 0 4px #fff;
}

.custom-radio:hover:not(:checked) {
    border-color: #0D47A1;
}

/* ==================== */
/* Header */
/* ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 50px;
}

.navbar .container {
    max-width: 95%;
    height: 50px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand img {
    height: 32px;
    width: auto;
}

div#navbarSupportedContent {
    justify-content: end;
}

/* ==================== */
/* Footer */
/* ==================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    height: 40px;
    background: #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}


.footer .container {
    max-width: 35%;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-icon {
    width: auto;
    height: 20px;
}

.footer-text {
    color: #3b4a6b;
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
}

/* ==================== */
/* Main Content */
/* ==================== */
main {
    padding-top: 45px; 
    padding-bottom: 45px;
    height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* ==================== */
/* Progress Bar */
/* ==================== */

.progress-container {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background-color: #d6dde5;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background-color: #0D47A1;
    transition: width 0.5s ease-in-out;
}


/* ==================== */
/* Login Specific Styles */
/* ==================== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 20px;
    overflow: hidden;
}

.login-form {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-form .form-group {
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
}

.login-form .form-group input {
    padding: 12px 15px;
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 300px;
}

.login-form .form-group label {
    text-align: center;
    display: block;
    margin-bottom: 8px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.login-form .error-message {
    text-align: center;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.login-form .submit-btn {
    margin-top: 15px;
}

.login-form .link {
    text-align: center;
    display: block;
    margin-top: 15px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== */
/* Media Queries */
/* ==================== */
@media (max-width: 768px) {
    main {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1030;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        height: 40px;
    }
    
    .navbar-brand img {
        height: 32px;
    }


    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1050;
        height: 40px;
        background: #fff;
    }

    .footer-text {
        font-size: 10px;
    }

    main {
        padding-top: 60px !important; /* Force higher padding to prevent overlap */
        padding-bottom: 50px;
        padding-top: 42px;
        height: auto;
        min-height: calc(100vh - 70px);    
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1100; /* Increased z-index */
        height: 50px;
      }

    .centered-view {
        padding: 0;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }
    .row {
        margin: 0;
        width: 100%;
    }

    .col-md-12 {
        padding: 0;
        width: 100%;
    }

    .card {
        border-radius: 8px;
        margin: 8px;
        width: calc(100% - 12px);
        box-sizing: border-box;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        background: #fff;
        margin: 6px;
        margin-top: 10px;
        margin-bottom: 50px;
    }

    .card-header {
        padding: 15px;
        background-color: #fff;
        border-bottom: 1px solid #dee2e6;
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        flex: 1 1 100%; 
        max-width: 100%; 
    }

    .card-body {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
        overflow-y: hidden;
    }

    h6 {
        margin: 15px 0;
        padding: 0 15px;
    }

    .survey-table {
        padding-top: 10px;
    }

    .survey-table {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        overflow-x: hidden;
        padding: 10px 0;
    }

    .table-header {
        display: none; 
    }

    .table-row {
        width: 100%;
        min-width: 0;
        margin: 0 0 15px 0;
        padding: 15px;
        display: block;
        box-sizing: border-box;
    }

    .question-col {
        width: 100%;
        min-width: 0;
        padding: 0 0 10px 0;
        white-space: normal;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }


    .question-number {
        display: inline-block;
        margin-right: 8px;
        vertical-align: top;
    }

    .question-text {
        display: inline;
        word-break: break-word;
    }


    .options-col {
        width: 100%;
        min-width: 0;
        margin: 5px 0;
        padding: 8px;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        background-color: #f8f9fa;
        border-radius: 4px;
        margin: 5px 0;
        padding: 10px;
        transition: background-color 0.2s ease;
    }
    .options-col:hover {
        background-color: #e9ecef;
    }

    h6 {
        padding: 10px;
        margin: 0 0 15px 0;
        width: 100%;
        box-sizing: border-box;
    }

    .options-col:hover {
        background-color: #e9ecef;
    }

    .options-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .options-col[data-option-name]::before {
        content: attr(data-option-name);
        margin-left: 10px;
        color: #495057;
        font-size: 14px;
        flex: 1;
        white-space: normal;
        word-wrap: break-word;
    }

   .custom-radio {
        margin-right: 10px;
        flex-shrink: 0;
    }

    .error-row {
        margin: 8px 15px;
        padding: 10px;
        border-radius: 4px;
        background-color: #fff3f3;
        width: 100%;
        box-sizing: border-box;
    }

    .center-content-questions {
        width: 100%;
        padding: 5px;
        margin: 0;
        overflow-x: hidden;
        box-sizing: border-box;
        height: calc(100vh - 140px);
        overflow-y: auto;
        height: auto;
        min-height: 200px;
        max-height: calc(100vh - 150px);
        padding-bottom: 60px;
    }

    .submit-btn {
        width: 80%;
        max-width: 200px;
        padding: 14px 20px;
    }

}

@media (max-width: 480px) {
    main {
    
        padding-top: 50px !important;
        padding-bottom: 50px;
    }

    .card {
        margin: 10px;
        width: calc(100% - 12px);
    }

    .navbar {
        height: 58px;
    }

    .navbar-brand {
        font-size: small;
    }

    .card-header {
        padding: 12px;
        padding: 10px;
    }
    .card-body {
        padding: 8px;
    }

    .survey-table {
        margin-bottom: 50px;
        padding-bottom: 20px;
     } 

    .center-content-questions {
        height: auto;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; 
    }

    .center-content{
        overflow-y: auto;
    }

    .section-center{
        padding-top: 150px;
    }

    .table-row {
        padding: 10px;
    }

    .question-col {
        font-size: 14px;
    }

    .options-col {
        padding: 6px;
    }
   
    h6 {
        font-size: 15px;
        line-height: 1.5;
        padding: 0 12px;
    }

    .center-content-questions {
        padding: 8px;
    }
    
    .options-col[data-option-name]::before {
        font-size: 13px;
        line-height: 1.4;
    }

    .error-row {
        margin: 6px 12px;
        padding: 8px;
    }

    .submit-btn {
        width: 90%;
        margin: 15px auto;
        padding: 12px 20px;
    }

    .center-content-questions {
        height: calc(100vh - 120px);
        padding: 3px;
    }

    .table-row {
        padding: 12px;
        margin-bottom: 10px;
    }

    .card {
        margin: 10px;
    }

    .footer .container{
        max-width: fit-content;
    }

    .footer-icon{
        width: auto;
        height: 20px;
    }
    .login-form {
        padding: 15px;
    }

    .login-form .form-group input {
        padding: 8px 12px;
    }

    .login-form .submit-btn {
        margin-top: 10px;
    }
}

@media (min-width: 800px) {
    .center-content-questions {
        height: calc(100vh - 180px);
        max-height: none;
    }

    main {
        padding-top: 42px;
        max-height: 100vh;
        overflow-x: hidden;
    }

    .card {
        margin: 10px auto;
        max-width: 1200px;
    }

    .center-content{
        overflow-y: auto;
        height: 70vh  !important;
    }
    
}


/* ==================== */
/* Layout Fixes - Add to end of CSS file */
/* ==================== */

/* General fixes */
body {
    overflow-y: auto;
    overflow-x: hidden;
}

main {
    padding-top: 45px;
    padding-bottom: 45px;
    height: auto;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

.centered-view {
    height: auto;
    min-height: calc(100vh - 90px);
    overflow-y: visible;
    margin-top: 25px;
}

.center-content-questions {
    height: auto;
    min-height: 300px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 5px;
    width: 100%;
    box-sizing: border-box;
}

.survey-table {
    max-height: none;
    overflow-y: visible;
    display: block;
    width: 100%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    main {
        padding-top: 45px;
        padding-bottom: 45px;
        height: auto;
    }
    
    .centered-view {
        height: auto;
        min-height: calc(100vh - 90px);
    }
    
    .center-content-questions {
        height: auto;
        min-height: 300px;
        max-height: calc(100vh - 120px);
    }
    
    .survey-table {
        margin-bottom: 0;
    }
    
    .card-body {
        padding: 10px 5px;
    }
    
    .submit-btn {
        margin: 10px auto;
    }
}

/* Wide screen optimizations */
@media (min-width: 1200px) {
    .card {
        width: 100%;
        max-width: 95%;
        margin: 10px auto;
    }
    
    .table-row, .table-header {
        grid-template-columns: minmax(300px, 3fr) repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .question-col {
        max-width: none;
    }

    .center-content{
        height: 83vh; 
    }
}

