/* Элементы управления */
.controls {
    margin-bottom: 25px;
}

.admin-only {
    display: none !important;
}

.search-controls {
    margin-bottom: 15px;
    width: 100%;
}

.list-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.search-controls.search-with-count {
    position: relative;
    flex: 1 1 320px;
    margin-bottom: 0;
}

.search-controls.search-with-count .search-input {
    padding-right: 150px;
}

.search-count {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 4px 0 14px;
    border-radius: 0;
    border-left: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    height: calc(100% - 18px);
    box-shadow: none;
}

.search-count::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0), rgba(0, 212, 255, 0.6), rgba(0, 212, 255, 0));
}

.sort-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    flex-wrap: wrap;
    position: relative;
}

.sort-merge {
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: 210px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: linear-gradient(135deg, rgba(2, 18, 38, 0.7), rgba(20, 34, 60, 0.7));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sort-merge:focus-within,
.sort-merge:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sort-merge select {
    border: none;
    border-radius: 0;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
}

.sort-divider {
    width: 1px;
    height: 28px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0), rgba(0, 212, 255, 0.6), rgba(0, 212, 255, 0));
}

.sort-merge .btn-sort-toggle {
    border: none;
    border-radius: 0;
    flex: 0 0 48px;
}

.sort-controls select {
    padding: 12px 14px;
    height: 48px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    min-width: 138px;
}

.sort-controls select:focus {
    outline: none;
    background: rgba(0, 212, 255, 0.08);
    box-shadow: none;
}

.order-type-filter {
    position: relative;
    flex: 0 0 auto;
    overflow: visible;
}

.btn-filter-toggle {
    position: relative;
    width: 48px;
    min-height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: var(--border-radius-small);
    border: 1px solid rgb(47 42 75 / 35%);
    background: linear-gradient(180deg, rgb(14 42 65 / 70%), rgb(8 29 45 / 70%));
    color: #dcd6ff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.25);
    overflow: visible;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

.btn-filter-toggle::before {
    display: none;
}

.btn-filter-toggle:hover,
.btn-filter-toggle[aria-expanded="true"] {
    outline: none;
    background: linear-gradient(180deg, rgba(24, 66, 100, 0.7), rgba(12, 43, 66, 0.7));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-filter-toggle:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 108, 66, 0.95);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 0 12px rgba(255, 108, 66, 0.35);
}

.filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.filter-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.order-type-filter-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.28);
    background: rgba(9, 16, 28, 0.96);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 20;
}

.order-type-filter-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 700;
}

.order-type-filter-menu__clear {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.order-type-filter-menu__clear:hover {
    color: #67e8f9;
}

.order-type-filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.order-type-filter-option:hover {
    background: rgba(0, 212, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.08);
}

.order-type-filter-option input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 6px;
    border: 1px solid rgba(48, 116, 163, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.order-type-filter-option input:hover {
    border-color: rgba(107, 160, 198, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 0 0 4px rgba(108, 92, 231, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.28);
}

.order-type-filter-option input:focus-visible {
    outline: none;
    border-color: rgba(170, 152, 255, 0.95);
    box-shadow:
        0 0 0 3px rgba(108, 92, 231, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 4px 10px rgba(0, 0, 0, 0.28);
}

.order-type-filter-option input:checked {
    border-color: rgba(83, 117, 191, 0.95);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 45%),
        linear-gradient(180deg, rgba(83, 117, 191, 0.98), rgba(42, 81, 128, 0.98));
    box-shadow:
        0 0 0 4px rgba(108, 92, 231, 0.14),
        0 6px 14px rgba(72, 49, 212, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.order-type-filter-option input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.order-type-filter-option input:active {
    transform: scale(0.94);
}

.order-type-filter-option span:last-child {
    font-weight: 600;
}

.sort-row .movies-count {
    margin-left: auto;
    margin-bottom: 0;
}

.movies-count {
    margin-bottom: 15px;
    padding: 12px 20px;
    height: 48px;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: var(--border-radius-small);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-weight: 600;
    color: var(--text-primary);
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    font-size: 1rem;
    background: linear-gradient(140deg, rgba(4, 16, 36, 0.82), rgba(20, 28, 50, 0.82));
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 20px rgba(0, 0, 0, 0.25);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: linear-gradient(140deg, rgba(8, 24, 44, 0.95), rgba(26, 36, 62, 0.95));
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.25),
        0 10px 24px rgba(0, 212, 255, 0.12);
}

.admin-divider {
    width: 100%;
    height: 2px;
    margin: 0px 0 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 212, 255, 0) 0%, rgba(139, 139, 139, 0.55) 50%, rgba(0, 212, 255, 0) 100%);
}

.admin-actions {
    width: 100%;
    margin-bottom: 24px;
}

.admin-action-button {
    width: 100%;
    height: 40px;
    padding: 6px 16px;

    border-radius: var(--border-radius-small);
    background: linear-gradient(180deg, rgb(49 31 129 / 70%), rgb(37 32 57 / 70%));
    border: 1px solid rgb(47 42 75 / 35%);
    color: #dcd6ff;

    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.25);

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

.admin-action-button:hover,
.admin-action-button:focus-visible {
    outline: none;
    background: linear-gradient(180deg, rgba(69, 50, 153, 0.7), rgba(47, 43, 66, 0.7));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.3);
}

.admin-action-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.admin-action-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.admin-action-divider {
    width: 2px;
}

.admin-action-main {
    flex: 1 1 90%;
    border-right: 0;
    border-radius: var(--border-radius-small) 0 0 var(--border-radius-small);
}

.order-type-filter--admin {
    flex: 0 0 56px;
}

.order-type-filter--admin .btn-filter-toggle {
    width: 56px;
    min-width: 56px;
    min-height: 40px;
    height: 40px;
}

.order-type-filter-menu--admin {
    right: 0;
}

.admin-action-filter {
    width: 56px;
    padding: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    flex: 0 0 56px;
}

.admin-action-icon {
    flex: 0 0 10%;
    min-width: 56px;
    border-left: 0;
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
    background: #0e2a41;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-action-icon:hover,
.admin-action-icon:focus-visible {
    background: #183f5f;
}

/* Input field with search button inside */
.input-with-btn {
    position: relative;
}

.input-with-btn .search-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.input-with-btn .search-btn:hover {
    color: var(--primary-color)
}

.input-with-btn input {
    padding-right: 40px;
}

.roulette-autofill-hint {
    display: none;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #ffd166;
}

.roulette-autofill-hint.is-visible {
    display: inline-flex;
}

.roulette-autofill-clear {
    border: none;
    background: rgba(255, 209, 102, 0.15);
    color: inherit;
    padding: 4px 8px;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.roulette-autofill-clear:hover,
.roulette-autofill-clear:focus-visible {
    background: rgba(255, 209, 102, 0.35);
    transform: scale(1.05);
    color: #ff6b6b;
}

.roulette-order-attention {
    animation: rouletteOrderPulse 1.4s ease-in-out infinite;
    border-color: rgba(139, 47, 224, 0.65);
    box-shadow: 0 0 12px rgba(101, 34, 148, 0.25);
}

@keyframes rouletteOrderPulse {
    0% {
        box-shadow: 0 0 0 rgba(217, 102, 255, 0.15);
    }
    50% {
        box-shadow: 0 0 16px rgba(157, 68, 209, 0.55);
    }
    100% {
        box-shadow: 0 0 0 rgba(217, 102, 255, 0.15);
    }
}

select {
    padding: 14px 20px;
    border: 2px solid rgba(255, 108, 66, 0.3);
    border-radius: var(--border-radius-small);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    appearance: none;
}

select option {
    background: var(--background);
    color: var(--text-primary);
}
