/* ----------------------------------------------------------------------
   MODERN WIDGETS (Choices.js) - Base & Overrides
   ---------------------------------------------------------------------- */

/* 1. Import Base Library Styles */
@import url('https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css');

/* ----------------------------------------------------------------------
   OVERRIDES (Matching Registration Form Design)
   ---------------------------------------------------------------------- */

/* Note: We use !important here because Choices.js uses very specific selectors 
   that are hard to override otherwise without complex nesting.
*/

/* Base Container - Looks like standard input */
.registrace-div .choices {
    border-radius: var(--border-radius-md, 12px);
    border: 1.5px solid var(--input-border, #b7e2b0);
    background: var(--input-bg, #f8fff5);
    box-shadow: 0 1.5px 4px 0 rgba(0, 0, 0, 0.03);
    padding: 0.3em 0.5em !important;
    min-height: 38px;
    font-size: 16px;
    /* Prevents zoom on mobile */
    margin-bottom: 0;
    transition: border 0.2s, background 0.2s;
}

/* Focus State */
.registrace-div .choices.is-focused {
    border-color: var(--color-primary, #5dbc00);
    background: var(--input-bg-focus, #f3fbe9);
}

/* Date of Birth Wrapper Hacks (Defensive Reset) */
/* This ensures the select inside the date wrapper behaves like a plain text part */
#dob-wrapper .choices {
    margin-bottom: 0 !important;
    padding: 0.3em 0.5em !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
}

#dob-wrapper .choices:not(:last-of-type) {
    border-right: 1px solid var(--input-border, #b7e2b0) !important;
    padding-right: 0.35em !important;
}

/* Inner Layout Reset */
.registrace-div .choices__inner {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 38px;
    display: flex;
    align-items: center;
}

/* Lists & Items Styling */
.registrace-div .choices__list--single {
    padding: 0 !important;
}

.registrace-div .choices__input,
.registrace-div .choices__item {
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

/* Dropdown Menu Styling */
.registrace-div .choices__list--dropdown,
.registrace-div .choices__list[aria-expanded] {
    border-radius: var(--border-radius-md, 12px) !important;
    border: 1.5px solid var(--input-border, #b7e2b0) !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    /* Slightly nicer shadow */
    font-size: 1.08em !important;
    margin-top: 4px !important;
}

/* Dropdown Items */
.registrace-div .choices__list--dropdown .choices__item--selectable {
    padding: 10px 15px !important;
}

.registrace-div .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--input-bg-focus, #f3fbe9) !important;
    color: var(--color-text-main, #333) !important;
}

/* Arrow / Placeholder adjustments */
.registrace-div .choices[data-type*="select-one"]::after {
    border-color: #666 transparent transparent transparent;
    right: 15px;
    transition: transform 0.2s ease;
}

.registrace-div .choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent #666 transparent;
    margin-top: -7.5px;
}

/* Time Input */
.time-modern {
    border-radius: var(--border-radius-md, 12px) !important;
    border: 1.5px solid var(--input-border, #b7e2b0) !important;
    background: var(--input-bg, #f8fff5) !important;
    box-shadow: 0 1.5px 4px 0 rgba(0, 0, 0, 0.03) !important;
    padding: 0.3em 0.7em !important;
    min-height: 38px !important;
    font-size: 16px !important;
    cursor: pointer;
    color: var(--color-text-main, #333) !important;
}

.time-modern:focus {
    border-color: var(--color-primary) !important;
    background: var(--input-bg-focus, #ebf7f8) !important;
    outline: none;
}

/* ----------------------------------------------------------------------
   CUSTOM FILE UPLOAD COMPONENT
   ---------------------------------------------------------------------- */
.abs-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.abs-file-wrapper {
    width: 100%;
}

.abs-file-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 12px;
    border: 1.5px solid var(--input-border, #b7e2b0);
    background: var(--input-bg, #f8fff5);
    padding: 0.3em 0.5em;
    box-shadow: 0 1.5px 4px 0 rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: border 0.2s, background 0.2s;
}

.abs-file-label:hover {
    border-color: var(--color-primary);
}

.abs-file-label.is-invalid {
    border: 1.5px solid var(--color-danger, #dc3545) !important;
    background-color: var(--bg-danger-light, #fff0f0) !important;
}

.abs-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.35em 1.2em;
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    margin-left: auto;
}

.abs-file-button svg {
    width: 22px;
    height: 22px;
}

.abs-file-name {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
    font-size: 1rem;
    font-weight: 500;
}

.abs-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ----------------------------------------------------------------------
   Custom Table Toggle Buttons
   ---------------------------------------------------------------------- */
.modern-table-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    border: 1.5px solid var(--input-border, #b7e2b0) !important;
    background: var(--input-bg, #f8fff5) !important;
    cursor: pointer;
    position: relative;
    transition: background-color 0.1s ease, border-color 0.1s ease !important;
    box-shadow: 0 1.5px 4px 0 rgba(0, 0, 0, 0.03) !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-table-toggle::after {
    content: "✕" !important;
    color: #999 !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    line-height: 1 !important;
}

.modern-table-toggle:checked {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.modern-table-toggle:checked::after {
    content: "✓" !important;
    color: #fff !important;
    font-size: 1.5rem !important;
}

.modern-table-toggle:hover {
    border-color: var(--color-primary) !important;
}

/* ----------------------------------------------------------------------
   MEDIA QUERIES FOR RESPONSIVENESS
   ---------------------------------------------------------------------- */

@media (max-width: 400px) {
    .program-table .choices__item.choices__item--selectable {
        margin: 1rem;
    }
}

@media (max-width: 383px) {
    .program-table .choices__item.choices__item--selectable {
        margin: 0.7rem;
    }
}

@media (max-width: 353px) {
    .program-table .choices__item.choices__item--selectable {
        margin: 0.3rem;
    }
}

@media (max-width: 323px) {
    .program-table .choices__item.choices__item--selectable {
        margin: 0.1rem;
    }
}