/* ========================================
   CUSTOM CSS - ORGANIZED
   ⚠️ DO NOT MODIFY EXISTING RULES
======================================== */

/* ========================================
   1. UTILITY CLASSES
======================================== */
.mini-red {
    font-size: 0.75rem;
    color: red;
}

.color-blanco {
    color: #fff;
}

.cienporciento {
    width: 100%;
}

.h5-title {
    font-size: 1.25em;
}

.sombra {
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

/* Material Design Shadows */
.box-shadow--1dp {
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14),
        0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.box-shadow--2dp {
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
        0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}

.azul {
    background-color: #005bbc;
    color: #fff;
}

.no-padding {
    padding: 0 !important;
}

.inline-checkbox {
    display: inline-block;
    margin-left: 5em;
    margin-right: 0.25em;
}

.alignment-right-center {
    text-align: center;
}

/* ========================================
   2. TYPOGRAPHY
======================================== */
.h3-title {
    font-size: 2em;
}

.titulo-pagina {
    float: left;
    font-size: 2rem;
    font-weight: 700;
}

.titulo-tarjeta {
    float: left;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 1em 0 0;
    padding: 0.25em 0.5em;
}

.question-size {
    font-size: 1rem;
}

.proceeding-title {
    margin: 5px 0 0 0;
    font-size: 1.5rem;
}

.text-btn-size {
    font-size: 1rem;
}

/* ========================================
   3. LAYOUT & SPACING
======================================== */
.menos-ticinco {
    margin-top: -25px;
}

.mas-seis {
    margin-top: 6px;
}

.adjust {
    margin-top: -10px !important;
    margin-bottom: -20px !important;
}

/* ========================================
   4. TABLES
======================================== */
.col_require {
    width: 61%;
    text-align: center;
}

.col_chk {
    width: 11%;
    text-align: center;
}

.col_action {
    width: 6%;
    text-align: center;
}

#validate-table thead th,
#validate-table tbody th,
#validate-table tbody td {
    padding: 4px 5px;
}

.thead-dark {
    color: #fff;
    background-color: #212529;
    border-color: #32383e;
}

/* ========================================
   5. NAVIGATION & TABS
======================================== */
.logo-letters-side {
    max-height: 100%;
    height: 10vh;
    margin-top: 7vh;
}

.nav > .nav-text-sm {
    text-align: center;
    font-size: 0.9rem;
}

.nav > li > a {
    padding-top: 3px;
    padding-bottom: 5px;
}

/* Tabs Container - Scrollable */
.tabs-container {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.tabs-nav-wrapper {
    flex-grow: 1;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs-nav-wrapper::-webkit-scrollbar {
    display: none;
}

.tabs-scroll-btn {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    display: none;
}

.tabs-scroll-btn.left {
    border-right: none;
}

.tabs-scroll-btn.right {
    border-left: none;
}

/* Bootstrap Tabs Styling */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    flex-wrap: nowrap;
}

.nav-tabs .nav-link {
    display: inline-block;
    white-space: nowrap;
    border-color: transparent;
    color: #495057;
    background-color: transparent;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    color: #343a40;
    border-bottom: 2px solid #343a40;
}

.nav-tabs .nav-link.active {
    color: #fff;
    background-color: #343a40;
    border-color: #343a40;
    border-radius: 0.25rem 0.25rem 0 0;
}

.nav-tabs .nav-link.active:hover,
.nav-tabs .nav-link.active:focus {
    background-color: #444c54;
    border-color: #444c54;
}

/* ========================================
   6. BUTTONS
======================================== */
.btn-danger:hover {
    border-color: #a81313;
    color: #a81313;
}

.btn-dark:hover {
    border-color: #333;
    color: #333;
}

.btn-info:hover {
    border-color: #066271;
    color: #066271;
}

.btn-light:hover {
    border-color: #333;
    color: #333;
}

.btn-link:hover {
    border-color: #0069d9;
    color: #0069d9;
}

.btn-primary:hover {
    border-color: #285e8e;
    color: #285e8e;
}

.btn-secondary:hover {
    border-color: #5a6268;
    color: #5a6268;
}

.btn-success:hover {
    border-color: #218838;
    color: #218838;
}

.btn-warning:hover {
    background-color: #333;
    border-color: #e0a800;
    color: #e0a800;
}

.btn-danger:hover,
.btn-dark:hover,
.btn-info:hover,
.btn-link:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-success:hover {
    background-color: #ccc;
}

#btnPrev:focus,
#btnPrev:active,
#btnNext:focus,
#btnNext:active {
    background-color: var(--warning, #ffc107) !important;
    box-shadow: none !important;
    outline: none;
}

/* ========================================
   7. FORMS & INPUTS
======================================== */
.custom-control-input:checked ~ .custom-control-label::before {
    color: #fff;
    border-color: #212529;
}

.custom-control-input:checked ~ .custom-control-label.red::before {
    background-color: red;
}

.custom-control-input:checked ~ .custom-control-label.blue::before {
    background-color: blue;
}

/* ========================================
   8. DROPDOWNS & SUBMENUS
======================================== */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 100%;
    left: 0;
    margin-top: 0.125rem;
    border-radius: 0.25rem;
}

.dropdown-submenu > .dropdown-item:after {
    display: block;
    content: "";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-top-color: #333;
    margin-top: 8px;
    margin-right: -10px;
}

/* ========================================
   9. IMAGES
======================================== */
.at-bottom img {
    vertical-align: bottom;
    border: 0;
}

/* ========================================
   10. MODALS
======================================== */
.modal-body p {
    line-height: 1rem;
}

/* ========================================
   11. FULLCALENDAR STYLES
======================================== */
#calendar {
    max-width: 100%;
    margin: 0 auto;
}

.fc {
    width: 100% !important;
}

.fc-toolbar-chunk .btn,
.fc-button-group > .btn {
    color: #fff !important;
    background-color: #343a40 !important;
    border-color: #343a40 !important;
}

.fc-toolbar-chunk .btn:hover,
.fc-button-group > .btn:hover,
.fc-button-group > .btn.active {
    background-color: #1d2124 !important;
    border-color: #1d2124 !important;
    box-shadow: none !important;
}

.fc-header-toolbar.fc-toolbar.fc-toolbar-ltr button {
    font-size: 0.65rem;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 0;
}

/* ========================================
   12. CSS CUSTOM PROPERTIES (VARIABLES)
======================================== */
:root {
    --bp-xs: 320px;
    --bp-sm: 375px;
    --bp-md: 414px;
    --bp-lg: 480px;
    --bp-xl: 720px;
    --padding-xs: 8px;
    --padding-sm: 12px;
    --padding-md: 16px;
    --padding-lg: 20px;
    --padding-xl: 24px;
}

/* ========================================
   13. RESPONSIVE STYLES
   ⚠️ CRITICAL: DO NOT MODIFY - OPTIMIZED FOR OLD iPhones
======================================== */

/* Desktop Only */
@media (min-width: 992px) {
    .desktop-only {
        display: block !important;
    }
}

/* Mobile Only */
@media (max-width: 991px) {
    .mobile-only {
        display: block !important;
    }
    .desktop-only {
        display: none !important;
    }
}

/* Modal Extra Large */
@media (min-width: 768px) {
    .modal-xl {
        width: 90%;
        max-width: 1200px;
    }
}

/* Small Screens (576px and below) */
@media (max-width: 576px) {
    .question-size {
        font-size: 0.95rem;
    }

    .proceeding-title {
        margin: 5px 0 0 0;
        font-size: 1rem;
    }

    .text-btn-size {
        font-size: 0.75rem;
    }

    table#tblChildren,
    table#tblFormerSpouse,
    table#tblMigratoryStatus {
        margin-bottom: 0;
    }

    ul.navbar-nav.ml-auto .nav-item .nav-link {
        font-size: 0.9rem !important;
        width: max-content !important;
        margin: -1rem 0 0 -1.2rem !important;
    }

    ul.navbar-nav.ml-auto .nav-item {
        margin-top: 1.2rem;
    }

    /* FullCalendar Mobile */
    .fc .fc-toolbar-title {
        font-size: 0.95em;
    }

    .fc .fc-button {
        padding: 0.25em 0.4em;
        font-size: 0.75em;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 40px;
    }

    .fc .fc-daygrid-day-number {
        font-size: 0.7em;
    }
}

/* Navigation Buttons (450px and below) */
@media (max-width: 450px) {
    #btnPrev,
    #btnNext,
    #btnSave,
    #btnExit,
    #btnNotes {
        font-size: 0.73rem !important;
    }
}

/* Very Small Screens - OLD iPhones (374px and below) */
@media only screen and (max-width: 374px) {
    .container {
        padding: 8px;
        font-size: 14px;
    }

    .button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    h5 b,
    h6 b {
        font-size: 0.9rem;
    }

    label {
        font-size: 0.8rem;
        line-height: 1rem;
    }

    label.form-check-label {
        font-size: 0.76rem;
    }

    label.form-check-label.question-size {
        font-size: 0.73rem;
    }

    h3.card-title.h3-title {
        font-size: 1.5em;
    }

    p {
        margin-bottom: 0;
        font-size: 0.8rem;
    }

    label[for="employer_number"] {
        font-size: 0.76rem;
    }

    label[for="applicant_mobile"] {
        font-size: 0.76rem;
    }

    h6.card-title.proceeding-title {
        font-size: 0.8rem;
    }

    button#btn-new-type-proceeding {
        font-size: 0.7rem;
    }

    .float-right.smallbuttons a {
        font-size: 0.65rem;
    }

    .noemploy {
        font-size: 1.4rem;
    }
}

/* Navigation Buttons (350px and below) */
@media (max-width: 350px) {
    #btnPrev,
    #btnNext,
    #btnSave,
    #btnExit,
    #btnNotes {
        font-size: 0.5399rem !important;
    }
}

/* Tablets & Mobile (768px and below) */
@media (max-width: 768px) {
    /* Responsive Tables */
    table thead {
        display: none;
    }

    table,
    table tbody,
    table tr,
    table td {
        display: block;
        width: 100%;
    }

    table tr {
        margin-bottom: 1rem;
        border: 1px solid #ccc;
        padding: 0.5rem;
        border-radius: 0.25rem;
    }

    table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        text-align: left;
        font-weight: bold;
        padding-left: 0.5rem;
    }

    /* Form Elements */
    label.form-check-label {
        font-size: 0.8rem;
    }

    p {
        margin-bottom: 0;
        font-size: 0.8rem;
    }

    label[for="employer_number"] {
        font-size: 0.9rem;
    }

    label[for="applicant_mobile"] {
        font-size: 0.9rem;
    }

    label.form-check-label[for="chkg28Attached"] {
        font-size: 0.9rem;
    }

    .alignment-right-center {
        text-align: right !important;
    }

    .employment {
        font-size: 1em !important;
    }

    li.nav-item.dropdown.user-menu {
        margin: 0.7rem 0 0 0.2rem !important;
    }

    .left input {
        text-align: left !important;
    }

    .center input {
        text-align: center !important;
    }

    .text-info {
        font-size: 1.1rem;
    }

    .fc-header-toolbar.fc-toolbar.fc-toolbar-ltr {
        font-size: 0.75rem;
    }

    /* FullCalendar Responsive Toolbar */
    .fc .fc-toolbar {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 1em;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .fc .fc-button {
        padding: 0.3em 0.5em;
        font-size: 0.85em;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1em;
    }

    .fc-event {
        font-size: 0.7em;
        padding: 1px 2px;
    }

    .fc .fc-col-header-cell {
        font-size: 0.75em;
        padding: 3px 1px;
    }

    .fc .fc-daygrid-day-number {
        font-size: 0.8em;
        padding: 2px;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 50px;
    }
}

/* Tablets (769px to 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .fc .fc-button {
        padding: 0.4em 0.65em;
        font-size: 0.9em;
    }

    .fc .fc-toolbar-title {
        font-size: 1.3em;
    }
}

/* ========================================
   14. FULLCALENDAR FIX - CRITICAL
   ⚠️ DO NOT REMOVE - Fixes table display conflict
======================================== */

/* Force FullCalendar tables to display correctly */
#calendar table,
#calendar table tbody,
#calendar table tr,
#calendar table td,
#calendar table th,
.fc table,
.fc table tbody,
.fc table tr,
.fc table td,
.fc table th {
    display: table !important;
}

#calendar table tbody,
.fc table tbody {
    display: table-row-group !important;
}

#calendar table tr,
.fc table tr {
    display: table-row !important;
}

#calendar table td,
#calendar table th,
.fc table td,
.fc table th {
    display: table-cell !important;
    width: auto !important;
    text-align: center !important;
    padding: 0 !important;
    position: static !important;
}

#calendar table td::before,
.fc table td::before {
    content: none !important;
}

#calendar thead,
.fc thead {
    display: table-header-group !important;
}

/* Ajustar altura del calendario */
#calendar {
    min-height: auto !important;
    height: auto !important;
}

.fc {
    height: auto !important;
}

.fc .fc-view-harness {
    min-height: auto !important;
    height: auto !important;
}

/* Altura de las celdas más compacta */
.fc .fc-daygrid-day {
    min-height: 80px !important;
    height: 80px !important;
}

.fc .fc-daygrid-day-frame {
    min-height: 80px !important;
    height: 80px !important;
}

/* Responsive - altura más compacta en móvil */
@media (max-width: 768px) {
    .fc .fc-daygrid-day {
        min-height: 60px !important;
        height: 60px !important;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 576px) {
    .fc .fc-daygrid-day {
        min-height: 50px !important;
        height: 50px !important;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 50px !important;
        height: 50px !important;
    }
}

/* END OF CSS */
.fc-header-toolbar.fc-toolbar.fc-toolbar-ltr .fc-toolbar-chunk:first-child {
    width: max-content !important;
    display: flex;
}

.expandable-body-table {
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
}

.expandable-body-table td {
    border-top: none;
    padding: 15px;
}

.expandable-body-table p {
    margin: 0;
    word-wrap: break-word;
}

.toggle-expand {
    transition: all 0.3s ease;
}

.toggle-expand:hover {
    transform: scale(1.1);
}
/* END OF CSS */
/* custom css for select2 */
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 5px;
    padding: 0 3px;
    border: none;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
    background-color: #9d9d9dff;
}

/* Make multiselect grow vertically when many clients are selected */
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: 38px !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: auto;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    padding: 2px 5px;
    width: 100%;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline {
    width: auto !important;
    min-width: 100px;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
    width: 100% !important;
    min-width: 100px;
}
/* END OF CSS */