/* ========================================
   TAG PICKER - Univerzální multi-select
   s možností vlastního vstupu
   BEM, MOBILE FIRST
   ======================================== */

.tag-picker {
    position: relative;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Vybrané tagy */
.tag-picker__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    order: 1;
}

.tag-picker__tags:empty {
    display: none;
    margin-top: 0;
}

.tag-picker__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px 4px 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #1a1a2e;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    line-height: 1.3;
    white-space: nowrap;
}

.tag-picker__tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.tag-picker__tag-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

.tag-picker__tag-remove svg {
    width: 12px;
    height: 12px;
}

/* Trigger tlačítko */
.tag-picker__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #9ca3af;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: left;
    box-sizing: border-box;
}

.tag-picker__trigger-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a2e;
    background: transparent;
    padding: 0;
    min-width: 0;
}

.tag-picker__trigger:hover {
    border-color: #d1d5db;
}

.tag-picker__trigger--active {
    border-color: #f97316;
}

.tag-picker__trigger-icon {
    display: flex;
    flex-shrink: 0;
    color: #d1d5db;
    transition: transform 0.2s;
}

.tag-picker__trigger--active .tag-picker__trigger-icon {
    transform: rotate(180deg);
    color: #f97316;
}

.tag-picker__trigger-icon svg {
    width: 16px;
    height: 16px;
}

.tag-picker__trigger-text {
    flex: 1;
}

/* Dropdown panel */
.tag-picker__dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 320px;
    overflow: hidden;
    flex-direction: column;
}

.tag-picker__dropdown--open {
    display: flex;
}

/* Seznam možností */
.tag-picker__list {
    overflow-y: auto;
    flex: 1;
    padding: 6px;
}

/* Skupina (kategorie) */
.tag-picker__group-label {
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
}

/* Položka */
.tag-picker__option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
    box-sizing: border-box;
}

.tag-picker__option:hover {
    background: #f9fafb;
}

.tag-picker__option--selected {
    color: #f97316;
    background: #fff7ed;
}

.tag-picker__option--selected:hover {
    background: #fff7ed;
}

.tag-picker__option-check {
    display: flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #f97316;
    opacity: 0;
}

.tag-picker__option--selected .tag-picker__option-check {
    opacity: 1;
}

.tag-picker__option-check svg {
    width: 16px;
    height: 16px;
}

.tag-picker__option-label {
    flex: 1;
}

/* Šipka u dvoustupňových položek */
.tag-picker__option-arrow {
    display: flex;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #d1d5db;
    transition: transform 0.2s;
}

.tag-picker__option-arrow svg {
    width: 14px;
    height: 14px;
}

.tag-picker__option--expanded .tag-picker__option-arrow {
    transform: rotate(90deg);
    color: #f97316;
}

.tag-picker__option--expanded {
    background: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}

.tag-picker__option--hidden {
    display: none;
}

/* Inline sub-panel (akordeon pod položkou) */
.tag-picker__inline-sub {
    background: #fffbf5;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    margin: 4px 0 6px 24px;
    padding: 10px 12px;
}

.tag-picker__inline-sub-label {
    font-size: 12px;
    font-weight: 600;
    color: #ea580c;
    margin-bottom: 8px;
}

.tag-picker__inline-sub-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-picker__sub-option {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.tag-picker__sub-option:hover {
    border-color: #f97316;
    color: #f97316;
    background: #fff7ed;
}

/* Vlastní hodnota - přidat */
.tag-picker__custom {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.tag-picker__custom-input {
    flex: 1;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #1a1a2e;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

.tag-picker__custom-input:focus {
    border-color: #f97316;
    background: #ffffff;
}

.tag-picker__custom-add {
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #f97316;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.tag-picker__custom-add:hover {
    background: #ea580c;
}

/* Tlačítko Hotovo */
.tag-picker__done {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #f97316;
    background: #fff7ed;
    border: none;
    border-top: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

.tag-picker__done:hover {
    background: #fed7aa;
}

/* Prázdný stav */
.tag-picker__empty {
    padding: 16px 10px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

/* ========================================
   TABLET+ (768px)
   ======================================== */

@media (min-width: 768px) {
    .tag-picker__dropdown {
        max-height: 360px;
    }
}
