/*
 * souq-promo.css
 * ─────────────────────────────────────────────────────────
 * Feature 1 : سوق مدينتكو — Entry Modal  (#sq-promo-modal)
 * Feature 2 : Floating Souq Button        (#sq-float-btn)
 * ─────────────────────────────────────────────────────────
 * يُحمَّل فقط على صفحات الموقع الرئيسي (ما عدا صفحة tmpitem)
 * عبر site/templates/foot.php
 */

/* ═══════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════ */
@keyframes sqModalIn {
    from { opacity: 0; transform: scale(.93) translateY(16px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
}
@keyframes sqOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes sqSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0);    }
}
@keyframes sqPulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(22,163,74,.55), 0 8px 28px rgba(22,163,74,.35); }
    50%       { box-shadow: 0 0 0 12px rgba(22,163,74,0),  0 8px 28px rgba(22,163,74,.35); }
}
@keyframes sqBounceIn {
    0%   { opacity: 0; transform: translateY(60px) scale(.7); }
    60%  { opacity: 1; transform: translateY(-8px) scale(1.07); }
    80%  { transform: translateY(4px) scale(.97); }
    100% { transform: translateY(0) scale(1); }
}
@keyframes sqGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(22,163,74,.6)); }
    50%       { filter: drop-shadow(0 0 14px rgba(22,163,74,.9)); }
}
@keyframes sqIconBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}
@keyframes sqBadgePop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    70%  { transform: scale(1.15) rotate(4deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
@keyframes sqTagline {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(2px); }
    75%     { transform: translateX(-2px); }
}


/* ═══════════════════════════════════════════════════
   FEATURE 1 — ENTRY MODAL
═══════════════════════════════════════════════════ */

/* Overlay */
#sq-promo-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 10, 25, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: sqOverlayIn .3s ease forwards;
    font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
    direction: rtl;
}

/* Hidden state */
#sq-promo-modal.sq-hidden {
    display: none !important;
}

/* Dialog card */
.sq-modal-card {
    position: relative;
    background: linear-gradient(145deg, #0d1f12 0%, #0f2317 40%, #0b1e1b 100%);
    border: 1px solid rgba(22, 163, 74, .25);
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(22,163,74,.1);
    animation: sqModalIn .38s cubic-bezier(.34,1.56,.64,1) forwards;
    overflow: hidden;
}

/* Glow strip top */
.sq-modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #16a34a, #4ade80, #16a34a, transparent);
}

/* City badge */
.sq-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(22, 163, 74, .15);
    border: 1px solid rgba(22, 163, 74, .35);
    color: #4ade80;
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 18px;
    animation: sqBadgePop .5s .2s cubic-bezier(.34,1.56,.64,1) both;
    letter-spacing: .02em;
}
.sq-modal-badge i { font-size: .75rem; animation: sqTagline 2s 1s ease-in-out infinite; }

/* Icon circle */
.sq-modal-icon {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, #15803d, #16a34a);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 28px rgba(22,163,74,.4);
    animation: sqGlow 2.5s 1s ease-in-out infinite, sqSlideUp .45s .1s ease both;
}
.sq-modal-icon i {
    font-size: 1.8rem;
    color: #fff;
    animation: sqIconBounce 2s 1.5s ease-in-out infinite;
}

/* Title */
.sq-modal-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #f0fdf4;
    margin: 0 0 10px;
    line-height: 1.35;
    animation: sqSlideUp .45s .15s ease both;
}
.sq-modal-title .sq-city-highlight {
    color: #4ade80;
    position: relative;
}

/* Description */
.sq-modal-desc {
    font-size: .95rem;
    color: #86efac;
    line-height: 1.65;
    margin: 0 0 28px;
    opacity: .9;
    animation: sqSlideUp .45s .2s ease both;
}

/* Features row */
.sq-modal-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
    animation: sqSlideUp .45s .25s ease both;
}
.sq-feat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #bbf7d0;
    font-size: .78rem;
}
.sq-feat-item i {
    font-size: 1.1rem;
    color: #4ade80;
}

/* Buttons */
.sq-modal-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: sqSlideUp .45s .3s ease both;
}

.sq-btn-enter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: linear-gradient(135deg, #15803d 0%, #16a34a 60%, #22c55e 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    padding: 15px 24px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, filter .2s;
    box-shadow: 0 6px 22px rgba(22,163,74,.4);
    letter-spacing: .01em;
}
.sq-btn-enter:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(22,163,74,.55);
    filter: brightness(1.08);
    color: #fff;
    text-decoration: none;
}
.sq-btn-enter i { font-size: 1rem; transition: transform .25s; }
.sq-btn-enter:hover i { transform: translateX(-4px); }

.sq-btn-skip {
    color: #86efac;
    border-color: rgba(74, 222, 128, .35);
    background: rgba(22,163,74,.07);

    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    border: 1px solid rgba(74, 222, 128, .15);
    border-radius: 10px;
    padding: 11px 20px;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
}
.sq-btn-skip:hover {
    color: white;
    background-color: steelblue;
}


/* ═══════════════════════════════════════════════════
   FEATURE 2 — FLOATING SOUQ BUTTON
═══════════════════════════════════════════════════ */

#sq-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;          /* opposite side from back-to-top (left: 30px) */
    z-index: 9997;        /* below back-to-top (9999) but well above content */
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #15803d, #16a34a);
    color: #fff;
    font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 50px;
    padding: 13px 20px 13px 16px;
    box-shadow: 0 8px 28px rgba(22,163,74,.35);
    border: none;
    cursor: pointer;
    /* hidden by default — JS adds .sq-float-visible */
    opacity: 0;
    pointer-events: none;
    transform: translateY(60px) scale(.7);
    transition: transform .25s, box-shadow .25s, filter .2s, opacity .15s;
    direction: rtl;
}

#sq-float-btn.sq-float-visible {
    opacity: 1;
    pointer-events: auto;
    animation: sqBounceIn .55s cubic-bezier(.34,1.56,.64,1) forwards,
               sqPulse     2.5s 1.5s ease-in-out infinite;
}

#sq-float-btn:hover {
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 0 14px 36px rgba(22,163,74,.55) !important;
    filter: brightness(1.1);
    color: #fff;
    text-decoration: none;
}

#sq-float-btn .sq-float-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform .25s;
}
#sq-float-btn:hover .sq-float-icon {
    transform: rotate(-12deg) scale(1.15);
}

#sq-float-btn .sq-float-label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
#sq-float-btn .sq-float-label span:first-child {
    font-size: .7rem;
    font-weight: 500;
    opacity: .8;
}
#sq-float-btn .sq-float-label span:last-child {
    font-size: .92rem;
    font-weight: 800;
}

/* Arrow */
#sq-float-btn .sq-float-arrow {
    font-size: .8rem;
    opacity: .75;
    transition: transform .25s;
    margin-right: 2px;
}
#sq-float-btn:hover .sq-float-arrow {
    transform: translateX(-3px);
    opacity: 1;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .sq-modal-card {
        padding: 28px 20px 22px;
        border-radius: 20px;
    }
    .sq-modal-title { font-size: 1.2rem; }
    .sq-modal-desc  { font-size: .88rem; }
    .sq-modal-features { gap: 14px; }
    .sq-modal-icon { width: 60px; height: 60px; }
    .sq-modal-icon i { font-size: 1.5rem; }

    #sq-float-btn {
        bottom: 20px;
        right: 16px;
        padding: 11px 16px 11px 13px;
        font-size: .85rem;
    }
    #sq-float-btn .sq-float-icon {
        width: 30px; height: 30px;
        font-size: .88rem;
    }
}
