/* =========================================================
   ROOMSERVICE FRONTEND
   ========================================================= */

.qr-ticket-wrapper {
    --primary: var(--primary-color, #0073aa);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 520px;
    margin: 30px auto;
    padding: 0 15px;
}

.qr-ticket-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ----- Header ----- */

.qr-ticket-header {
    background: var(--primary);
    color: white;
    padding: 30px 25px 25px;
    text-align: center;
}
.qr-info-notice {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border-left: 3px solid var(--primary-color, #0073aa);
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}

.qr-info-notice:empty {
    display: none;
}

.qr-ticket-header h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.qr-ticket-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.5;
}

.qr-ticket-zimmer-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 18px;
    border-radius: 20px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
}

/* ----- Form ----- */

.qr-ticket-form {
    padding: 25px;
}

.qr-ticket-form.is-disabled {
    opacity: 0.55;
    filter: grayscale(0.2);
    pointer-events: none;
}

.qr-disabled-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.qr-network-notice {
    margin: 24px 25px 0;
    padding: 16px 18px;
    border-radius: 12px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #78350f;
}

.qr-network-notice h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

.qr-network-notice p {
    margin: 0;
    line-height: 1.5;
}

.qr-network-notice-ip {
    margin-top: 8px !important;
    font-size: 12px;
    opacity: 0.8;
}

.qr-field-group {
    margin-bottom: 20px;
}

.qr-field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.required {
    color: #ef4444;
}

.qr-field-group input[type="text"],
.qr-field-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
    box-sizing: border-box;
    font-family: inherit;
}

.qr-field-group input[type="text"]:focus,
.qr-field-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.qr-field-group input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.qr-field-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 4px 0 0;
}

.qr-field-group textarea {
    resize: vertical;
    min-height: 70px;
}

/* =========================================================
   CUSTOM DROPDOWN
   ========================================================= */

.qr-dropdown {
    position: relative;
    user-select: none;
}

/* Trigger / Button */
.qr-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

.qr-dropdown-trigger:hover {
    border-color: #d1d5db;
}

.qr-dropdown.open .qr-dropdown-trigger {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.qr-dropdown-placeholder {
    color: #9ca3af;
    font-size: 15px;
}

.qr-dropdown-trigger .qr-dropdown-count {
    color: #374151;
    font-size: 15px;
    font-weight: 500;
}

.qr-dropdown-arrow {
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.qr-dropdown.open .qr-dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Menu – FIXED positioniert, wird per JS platziert */
.qr-dropdown-menu {
    display: none;
    position: fixed;
    background: #fff;
    border: 2px solid var(--primary, #0073aa);
    border-radius: 10px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 999999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overscroll-behavior: contain;
}

.qr-dropdown.open .qr-dropdown-menu {
    display: block;
    animation: dropdownSlide 0.15s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Kategorie-Header */
.qr-dropdown-category {
    padding: 10px 14px 5px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    z-index: 1;
}

.qr-dropdown-category:first-child {
    border-top: none;
}

/* Einzelner Eintrag */
.qr-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 15px;
    color: #374151;
    border-bottom: 1px solid #f9fafb;
}

.qr-dropdown-item:last-child {
    border-bottom: none;
}

.qr-dropdown-item:hover {
    background: #f0f7ff;
}

.qr-dropdown-item.selected {
    background: rgba(0, 115, 170, 0.06);
    font-weight: 600;
}

.qr-dropdown-item.selected:hover {
    background: rgba(0, 115, 170, 0.1);
}

/* Check-Icon */
.qr-dropdown-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.15s;
    color: transparent;
    background: #fff;
}

.qr-dropdown-item.selected .qr-dropdown-check {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.qr-dropdown-item-text {
    flex: 1;
    line-height: 1.3;
}

/* Scrollbar */
.qr-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.qr-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.qr-dropdown-menu::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* =========================================================
   SELECTED TAGS
   ========================================================= */

.qr-selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    min-height: 0;
}

.qr-selected-tags:empty {
    display: none;
}

.qr-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 5px 10px 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    animation: tagAppear 0.2s ease;
    line-height: 1.3;
}

.qr-selected-tag .tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}

.qr-selected-tag .tag-remove:hover {
    background: rgba(255, 255, 255, 0.45);
}

@keyframes tagAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================================================
   SUBMIT BUTTON
   ========================================================= */

.qr-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 5px;
}

.qr-submit-btn:hover {
    opacity: 0.9;
}

.qr-submit-btn:active {
    transform: scale(0.99);
}

.qr-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================
   SUCCESS / ERROR
   ========================================================= */

.qr-ticket-success {
    text-align: center;
    padding: 45px 25px;
}

.qr-ticket-success::before {
    /* content: '✅'; */
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

.qr-ticket-success h3 {
    font-size: 22px;
    color: #065f46;
    margin: 0 0 12px;
}

.qr-ticket-success p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.ticket-number {
    margin-top: 18px;
    padding: 10px 20px;
    background: #ecfdf5;
    border-radius: 8px;
    display: inline-block;
    font-size: 15px;
    color: #065f46;
}

.qr-new-request-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.qr-new-request-btn:hover {
    opacity: 0.9;
}

.qr-ticket-error {
    text-align: center;
    padding: 45px 25px;
}

.qr-ticket-error::before {
    content: '❌';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

.qr-ticket-error h3 {
    font-size: 22px;
    color: #991b1b;
    margin: 0 0 12px;
}

.qr-ticket-error p {
    color: #6b7280;
}

.qr-retry-btn {
    margin-top: 18px;
    padding: 10px 25px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.qr-retry-btn:hover {
    opacity: 0.9;
}

/* =========================================================
   VALIDATION
   ========================================================= */

.qr-field-error .qr-dropdown-trigger {
    border-color: #ef4444 !important;
}

.qr-field-error input,
.qr-field-error textarea {
    border-color: #ef4444 !important;
}

.qr-field-error-msg {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 480px) {
    .qr-ticket-wrapper {
        margin: 15px auto;
        padding: 0 10px;
    }

    .qr-ticket-header {
        padding: 22px 18px 20px;
    }

    .qr-ticket-form {
        padding: 18px;
    }

    .qr-dropdown-item {
        padding: 12px 14px;
    }
}
