/* نافذة الشكاوى — متوافقة مع ألوان وشكل الدردشة */
.yc-complaint-overlay {
    position: fixed;
    inset: 0;
    z-index: 100080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    background: rgba(8, 12, 28, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: ycComplaintFadeIn 0.22s ease;
}

@keyframes ycComplaintFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ycComplaintSlideUp {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.yc-complaint-modal {
    position: relative;
    width: min(400px, 94vw);
    max-height: min(90vh, 640px);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
    animation: ycComplaintSlideUp 0.26s ease;
}

.yc-complaint-modal__header {
    position: relative;
    padding: 0.9rem 1rem 0.85rem;
    text-align: center;
    background: var(--yc-complaint-header-bg, var(--primary-color, #337ab7));
    color: var(--yc-complaint-header-fg, #fff);
    border-bottom: 3px solid color-mix(in srgb, var(--yc-complaint-header-bg, #337ab7) 75%, #000);
    flex-shrink: 0;
}

.yc-complaint-modal__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 0.4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    padding: 0.2rem;
}

.yc-complaint-modal__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}

.yc-complaint-modal__header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.yc-complaint-modal__close {
    position: absolute;
    left: 0.65rem;
    top: 0.6rem;
    z-index: 3;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.yc-complaint-modal__close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.yc-complaint-modal__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yc-complaint-header-bg, #2c5282);
    background: linear-gradient(135deg, rgba(44, 82, 130, 0.1), rgba(44, 82, 130, 0.04));
    border: 1px solid rgba(44, 82, 130, 0.18);
    border-radius: 999px;
    width: 100%;
    box-sizing: border-box;
}

.yc-complaint-modal__badge .fa {
    opacity: 0.85;
}

.yc-complaint-modal__body {
    padding: 0.85rem 1rem 0.65rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, var(--yc-complaint-body-bg, #f8fafc) 0%, #fff 100%);
    flex: 1 1 auto;
}

.yc-complaint-field {
    margin-bottom: 0.65rem;
}

.yc-complaint-field label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
}

.yc-complaint-field label .fa {
    color: var(--yc-complaint-header-bg, #2c5282);
    opacity: 0.9;
    font-size: 0.72rem;
}

.yc-complaint-field input.form-control,
.yc-complaint-field textarea.form-control {
    border: 1px solid #dbe3f0;
    border-radius: 8px;
    padding: 0.48rem 0.6rem;
    font-size: 0.8rem;
    background: #fff;
    color: #0f172a;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.yc-complaint-field input.form-control:focus,
.yc-complaint-field textarea.form-control:focus {
    border-color: var(--yc-complaint-header-bg, #2c5282);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--yc-complaint-header-bg, #2c5282) 22%, transparent);
    outline: none;
}

.yc-complaint-field__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    color: #94a3b8;
}

.yc-complaint-modal__ctx {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: #475569;
    margin-top: 0.15rem;
    padding: 0.45rem 0.55rem;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

.yc-complaint-modal__ctx .fa {
    color: var(--yc-complaint-header-bg, #2c5282);
}

.yc-complaint-upload {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem 0.65rem;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.yc-complaint-upload:hover,
.yc-complaint-upload.yc-complaint-upload--drag {
    border-color: var(--yc-complaint-header-bg, #2c5282);
    background: color-mix(in srgb, var(--yc-complaint-header-bg, #2c5282) 6%, #fff);
}

.yc-complaint-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.yc-complaint-upload__icon {
    font-size: 1.35rem;
    color: var(--yc-complaint-header-bg, #2c5282);
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.yc-complaint-upload__title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.15rem;
}

.yc-complaint-upload__hint {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.45;
}

.yc-complaint-upload__status {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    color: #64748b;
    min-height: 1em;
}

.yc-complaint-upload__status--ok {
    color: #059669;
    font-weight: 600;
}

.yc-complaint-modal__preview {
    margin-top: 0.55rem;
    text-align: center;
    position: relative;
}

.yc-complaint-modal__preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.yc-complaint-modal__preview-remove {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    border: none;
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
}

.yc-complaint-modal__footer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem 0.9rem;
    border-top: 1px solid #e8ecef;
    background: #fff;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.yc-complaint-modal__cancel {
    min-width: 5.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.48rem 0.75rem;
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #475569;
}

.yc-complaint-modal__submit {
    min-width: 8.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.48rem 0.85rem;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--yc-complaint-header-bg, #2c5282) 35%, transparent);
    transition: filter 0.15s ease, transform 0.12s ease;
}

.yc-complaint-modal__submit:hover:not(:disabled),
.yc-complaint-modal__submit:focus:not(:disabled) {
    filter: brightness(0.94);
    transform: translateY(-1px);
}

.yc-complaint-modal__submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

@media (min-width: 768px) {
    .yc-complaint-modal {
        width: min(420px, 42vw);
    }
}

/* Bootstrap legacy modal (إن وُجد) */
#chat_complaint_modal.chat-complaint-modal {
    z-index: 10060;
}
