/* =====================================================
   PART 4 SYSTEM CSS — Tap-to-Fill Overrides
   Yaklaşım A: Popup KULLANILMIYOR, tıkla-doldur sistemi
   ===================================================== */

/* 1) Popup'ları KESİNLİKLE gizle (eski popup-based yaklaşım) */
.p4-gap-popup,
.p4-gap-popup.p4-popup-open {
    display: none !important;
}

/* 2) Word Bank kartları artık tıklanabilir → cursor pointer */
.p4-word-card {
    cursor: pointer !important;
}
.p4-word-card.p4-used,
.p4-word-card.p4-example-word {
    cursor: not-allowed !important;
}

.p4-word-card:not(.p4-used):not(.p4-example-word):hover {
    border-color: #2563EB !important;
    background: #EFF6FF !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}
.p4-word-card:not(.p4-used):not(.p4-example-word):active {
    transform: translateY(0) scale(0.97);
}

/* 3) "Davet" animasyonu — Aktif boşluk olduğunda Word Bank kartlarını yanıp söndür */
.p4-word-card.p4-word-invite {
    animation: p4WordInvite 1.4s ease-in-out infinite;
    border-color: #F59E0B !important;
    background: #FFFBEB !important;
}
@keyframes p4WordInvite {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* 4) Aktif boşluk — turuncu çerçeve + pulse */
.p4-gap.p4-gap-ready {
    background: #FFFBEB !important;
    border-bottom-color: #F59E0B !important;
    border: 2px dashed #F59E0B !important;
    border-bottom-width: 3px !important;
    color: #92400E !important;
    animation: p4GapActive 1.2s ease-in-out infinite;
    position: relative;
}

@keyframes p4GapActive {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

/* 5) Aktif boşluktan önce "👉" emoji göster */
.p4-gap.p4-gap-ready::before {
    content: '👉 ';
    margin-right: 2px;
    animation: p4Point 1s ease-in-out infinite;
}
@keyframes p4Point {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-3px); }
}

/* 6) Dolu boşluk içindeki ✕ butonu daha güzel */
.p4-gap-remove {
    display: inline-block;
    margin-left: 6px;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #6B7280;
    font-size: 10px !important;
    font-weight: 900;
    opacity: 0.7;
    transition: all 0.15s;
}
.p4-gap-remove:hover {
    background: #EF4444;
    color: white;
    opacity: 1;
    transform: scale(1.15);
}

/* 7) Doğru/yanlış sonucunda ✕ butonunu gizle */
.p4-gap.p4-gap-correct .p4-gap-remove,
.p4-gap.p4-gap-wrong .p4-gap-remove {
    display: none;
}

/* 8) Feedback mesajı animasyonu */
.p4-feedback:not(:empty) {
    animation: p4FbIn 0.3s ease-out;
}
@keyframes p4FbIn {
    0%   { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 9) Mobile uyumluluk */
@media (max-width: 620px) {
    .p4-gap {
        min-width: 70px;
        font-size: 0.82rem;
    }
    .p4-gap.p4-gap-ready::before {
        content: '👉';
        margin-right: 1px;
    }
}
