/* ByeBuy Modal Styles - Premium Glassmorphism & RTL Design */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

:root {
    --byebuy-primary: #4f46e5; /* Indigo 600 */
    --byebuy-primary-hover: #4338ca; /* Indigo 700 */
    --byebuy-bg: rgba(255, 255, 255, 0.95);
    --byebuy-text: #1f2937; /* Gray 800 */
    --byebuy-text-muted: #6b7280; /* Gray 500 */
    --byebuy-border: rgba(229, 231, 235, 0.8);
    --byebuy-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --byebuy-radius: 24px;
    --byebuy-font: 'Vazir', system-ui, -apple-system, sans-serif;
}

.byebuy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.7); /* Darker overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999999; /* Max z-index */
    display: none;
    justify-content: center;
    align-items: center;
    font-family: var(--byebuy-font);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.byebuy-overlay.active {
    opacity: 1;
}

.byebuy-modal {
    background: var(--byebuy-bg);
    padding: 40px;
    border-radius: var(--byebuy-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--byebuy-shadow);
    position: relative;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.byebuy-overlay.active .byebuy-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Typography */
.byebuy-modal h2 {
    margin: 0 0 12px 0;
    color: var(--byebuy-text);
    font-weight: 800;
    font-size: 26px;
    line-height: 1.3;
}

.byebuy-modal p {
    color: var(--byebuy-text-muted);
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

/* Close Button */
.byebuy-close {
    position: absolute;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--byebuy-text-muted);
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
}

.byebuy-close:hover {
    background: rgba(0,0,0,0.1);
    color: var(--byebuy-text);
    transform: rotate(90deg);
}

/* Reasons Grid */
.byebuy-reasons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.byebuy-reason-btn {
    background: #fff;
    border: 1px solid var(--byebuy-border);
    padding: 16px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--byebuy-text);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.byebuy-reason-btn:hover {
    border-color: var(--byebuy-primary);
    color: var(--byebuy-primary);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.1);
}

.byebuy-reason-btn span {
    font-size: 18px;
    opacity: 0.5;
    transition: transform 0.2s;
}

.byebuy-reason-btn:hover span {
    opacity: 1;
}

/* Step 2: Details */
.byebuy-step-2 {
    display: none;
}

.byebuy-other-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--byebuy-border);
    border-radius: 16px;
    font-family: var(--byebuy-font);
    font-size: 15px;
    min-height: 120px;
    margin-bottom: 24px;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: #f9fafb;
}

.byebuy-other-input:focus {
    border-color: var(--byebuy-primary);
    background: #fff;
    outline: none;
}

/* Actions */
.byebuy-actions {
    display: flex;
    gap: 12px;
}

.byebuy-submit {
    background: var(--byebuy-primary);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    flex: 2;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.byebuy-submit:hover {
    background: var(--byebuy-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.byebuy-submit:active {
    transform: translateY(0);
}

.byebuy-back {
    background: transparent;
    color: var(--byebuy-text-muted);
    border: 1px solid var(--byebuy-border);
    padding: 14px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    transition: all 0.2s;
}

.byebuy-back:hover {
    background: #f3f4f6;
    color: var(--byebuy-text);
    border-color: #d1d5db;
}

/* Thank You State */
.byebuy-thank-you {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.byebuy-thank-you svg {
    width: 80px;
    height: 80px;
    fill: #10b981; /* Emerald 500 */
    margin-bottom: 20px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.byebuy-thank-you h3 {
    color: var(--byebuy-text);
    margin: 0;
    font-size: 24px;
}

/* RTL Specific Styles */
.byebuy-overlay.rtl .byebuy-modal {
    text-align: right;
    direction: rtl;
}

.byebuy-overlay.rtl .byebuy-close {
    left: 20px;
    right: auto;
}

.byebuy-overlay.rtl .byebuy-reason-btn {
    text-align: right;
}

.byebuy-overlay.rtl .byebuy-reason-btn:hover {
    transform: translateX(-5px); /* Move left for RTL */
}

.byebuy-overlay.rtl .byebuy-reason-btn span {
    transform: rotate(180deg); /* Flip arrow for RTL */
}

/* LTR Specific Styles */
.byebuy-overlay.ltr .byebuy-modal {
    text-align: left;
    direction: ltr;
}

.byebuy-overlay.ltr .byebuy-close {
    right: 20px;
    left: auto;
}

.byebuy-overlay.ltr .byebuy-reason-btn {
    text-align: left;
}

.byebuy-overlay.ltr .byebuy-reason-btn:hover {
    transform: translateX(5px); /* Move right for LTR */
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .byebuy-modal {
        padding: 30px 20px;
        width: 85%;
        border-radius: 20px;
    }

    .byebuy-modal h2 {
        font-size: 22px;
    }

    .byebuy-reason-btn {
        padding: 14px;
        font-size: 14px;
    }
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}