/**
 * Shemesh Coupon Validator CSS - עם תמיכה בקופונים מרובים
 */

/* כפתור - הסרת רווחים מיותרים */
.shemesh-coupon-container {
    display: inline-block; /* שינוי מ-block ל-inline-block */
    margin: 0; /* הסרת שוליים */
    padding: 0; /* הסרת ריפוד */
    line-height: 0; /* מניעת רווח אנכי נוסף */
}

#shemesh-coupon-button {
    background-color: #E40019;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    margin: 0; /* הסרת שוליים */
    line-height: normal; /* החזרת גובה שורה תקין לטקסט בכפתור */
}

/* מסך כהה מאחורי הפופאפ */
.shemesh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* סגנון בסיסי לפופאפ */
#shemesh-coupon-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 100%); /* התחלה מחוץ למסך (למטה) */
    background: white;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

/* מצב פעיל לפופאפ - בשימוש בקוד JavaScript */
#shemesh-coupon-dialog.active {
    transform: translate(-50%, -50%); /* מיקום סופי במרכז המסך */
    opacity: 1;
}

/* מצב פעיל לאוברליי - בשימוש בקוד JavaScript */
.shemesh-modal-overlay.active {
    opacity: 1;
}

/* תוכן הפופאפ */
.shemesh-coupon-dialog-content {
    padding: 30px;
    text-align: center;
}

/* כותרת */
.shemesh-coupon-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 25px;
    text-align: center;
}

/* כפתור סגירה */
.shemesh-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 22px;
    color: #C9292E;
    cursor: pointer;
}

/* רשימת קופונים פעילים */
.shemesh-active-coupons-container {
    margin-bottom: 25px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    text-align: right;
    direction: rtl;
}

.shemesh-active-coupons-container h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.shemesh-active-coupons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shemesh-active-coupon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.shemesh-active-coupon-item:last-child {
    border-bottom: none;
}

.shemesh-remove-coupon {
    background-color: transparent;
    color: #C9292E;
    border: 1px solid #C9292E;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.shemesh-remove-coupon:hover {
    background-color: #C9292E;
    color: white;
}

/* שדה קלט */
.coupon-input-container {
    margin-bottom: 25px;
}

#shemesh-coupon-code {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    background-color: #f5f5f5;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

/* כפתור אישור */
.coupon-submit-btn {
    background-color: #C9292E;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

/* הודעות */
#shemesh-coupon-message {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

#shemesh-coupon-message.hidden {
    display: none;
}

#shemesh-coupon-message.success {
    background-color: #eefaf0;
    color: #28a745;
    border: 1px solid #d4edda;
}

#shemesh-coupon-message.error {
    background-color: #fff5f5;
    color: #E40019;
    border: 1px solid #ffe0e0;
}

/* אנימציית טעינה */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* מניעת גלילה כשהפופאפ פתוח */
body.shemesh-modal-open {
    overflow: hidden;
}

/* התאמות למובייל */
@media (max-width: 767px) {
    #shemesh-coupon-dialog {
        width: 85%;
        max-width: 85%;
    }
    
    .shemesh-coupon-dialog-content {
        padding: 25px 20px;
    }
    
    .shemesh-coupon-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .shemesh-active-coupon-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .shemesh-remove-coupon {
        margin-top: 5px;
    }
}