/**
 * Help Popup Styles
 * Lightweight support ticket creation modal
 */

/* Help Button - Round style matching favorites button */
.rd-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    margin: 0;
    margin-right: 10px;
    background: #68e7fb;
    border: none;
    border-radius: 50% !important;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(104, 231, 251, 0.3);
    position: relative;
    overflow: hidden;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}



.rd-help-btn:hover {
    background: #4dd9f0;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(104, 231, 251, 0.4);
}

.rd-help-btn:focus {
    outline: 2px solid #68e7fb;
    outline-offset: 2px;
}

.rd-help-btn .rd-help-icon {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

/* Compact variant */
.rd-help-btn.rd-help-btn--compact {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    box-shadow: none;
}

.rd-help-btn.rd-help-btn--compact .rd-help-icon {
    width: 18px;
    height: 18px;
}

.rd-help-btn.rd-help-btn--compact:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: scale(1.05);
}

/* Popup Modal */
.rd-help-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rd-help-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.rd-help-popup__container {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rd-help-popup-in 0.2s ease-out;
}

@keyframes rd-help-popup-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.rd-help-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.rd-help-popup__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.rd-help-popup__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rd-help-popup__close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Content */
.rd-help-popup__content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.rd-help-popup__subtitle {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    color: #6b7280;
}

/* Reason cards (Step 1) */
.rd-help-popup__reasons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rd-help-popup__reason {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rd-help-popup__reason:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.rd-help-popup__reason.selected {
    background: #eef2ff;
    border-color: #6366f1;
}

.rd-help-popup__reason-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.rd-help-popup__reason-content {
    flex: 1;
    min-width: 0;
}

.rd-help-popup__reason-label {
    display: block;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.rd-help-popup__reason-desc {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Context info (Step 2) */
.rd-help-popup__context {
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.8125rem;
    color: #6b7280;
}

.rd-help-popup__context:empty {
    display: none;
}

/* Form fields */
.rd-help-popup__field {
    margin-bottom: 14px;
}

.rd-help-popup__input,
.rd-help-popup__textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9375rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.rd-help-popup__input:focus,
.rd-help-popup__textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.rd-help-popup__textarea {
    resize: vertical;
    min-height: 100px;
}

.rd-help-popup__field-row {
    display: flex;
    gap: 10px;
}

.rd-help-popup__input--half {
    flex: 1;
}

/* Upload area */
.rd-help-popup__upload {
    margin-bottom: 16px;
}

.rd-help-popup__upload-label {
    cursor: pointer;
}

.rd-help-popup__upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #6b7280;
    transition: all 0.15s ease;
}

.rd-help-popup__upload-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.rd-help-popup__preview {
    margin-top: 10px;
    position: relative;
    display: inline-block;
}

.rd-help-popup__preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.rd-help-popup__preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Guest contact fields */
.rd-help-popup__guest-fields {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.rd-help-popup__contact-label {
    margin: 0 0 4px;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.rd-help-popup__contact-hint {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Privacy consent checkbox */
.rd-help-popup__privacy {
    margin-top: 16px;
}

.rd-help-popup__privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.4;
}

.rd-help-popup__privacy-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #68e7fb;
}

.rd-help-popup__privacy-text a {
    color: #68e7fb;
    text-decoration: underline;
}

.rd-help-popup__privacy-text a:hover {
    color: #4dd9f0;
}

/* Success state */
.rd-help-popup__success {
    text-align: center;
    padding: 20px 0;
}

.rd-help-popup__success-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.rd-help-popup__success-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.rd-help-popup__success-message {
    margin: 0;
    color: #6b7280;
}

/* Error display */
.rd-help-popup__error {
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 12px;
}

/* Footer */
.rd-help-popup__footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.rd-help-popup__btn {
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.rd-help-popup__btn--back {
    background: transparent;
    color: #6b7280;
}

.rd-help-popup__btn--back:hover {
    background: #e5e7eb;
    color: #374151;
}

.rd-help-popup__btn--submit {
    background: rgb(82, 197, 255);
    color: white;
    margin-left: auto;
}

.rd-help-popup__btn--submit:hover {
    background: rgb(60, 175, 235);
}

.rd-help-popup__btn--submit:disabled {
    background: rgba(82, 197, 255, 0.5);
    cursor: not-allowed;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .rd-help-popup {
        padding: 0;
        align-items: flex-end;
    }
    
    .rd-help-popup__container {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        animation: rd-help-popup-in-mobile 0.25s ease-out;
    }
    
    @keyframes rd-help-popup-in-mobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .rd-help-popup__content {
        padding: 16px;
    }
    
    .rd-help-popup__reason {
        padding: 12px 14px;
    }
}

/* Modern Menu integration - topbar */
.mm-topbar__btn--help {
    padding: 8px;
}

.mm-topbar__btn--help svg {
    width: 24px;
    height: 24px;
}

/* Modern Menu integration - bottombar */
.mm-bottombar__item--help {
    position: relative;
}
