/* ========================================
   Strategy Badge Manager Styles
   Professional Teaching Strategy Overlay
   ======================================== */

/* Overlay */
.strategy-badge-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.strategy-badge-overlay.show {
    display: flex;
    opacity: 1;
    animation: stbFadeIn 0.3s ease forwards;
}

@keyframes stbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Card */
.stb-modal {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: stbSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    font-family: 'Outfit', sans-serif;
    color: white;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.stb-modal::-webkit-scrollbar { width: 5px; }
.stb-modal::-webkit-scrollbar-track { background: transparent; }
.stb-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

@keyframes stbSlideUp {
    from { transform: translateY(24px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header */
.stb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stb-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.stb-title i {
    color: #a78bfa;
    font-size: 1rem;
}

.stb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Language Toggle */
.stb-lang-toggle {
    cursor: pointer;
    user-select: none;
}

.stb-lang-track {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3px 5px;
    position: relative;
    transition: all 0.3s ease;
}

.stb-lang-label {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 14px;
    color: #64748b;
    z-index: 1;
    position: relative;
    transition: color 0.3s ease;
}

.stb-lang-label.active {
    color: white;
}

.stb-lang-thumb {
    position: absolute;
    width: 50%;
    height: calc(100% - 4px);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 16px;
    top: 2px;
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.stb-lang-track.en-active .stb-lang-thumb { left: 2px; }
.stb-lang-track.ar-active .stb-lang-thumb { left: calc(50% - 2px); }

/* Close Button */
.stb-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.stb-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: rotate(90deg);
}

/* AI Suggest Banner */
.stb-ai-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 16px 6px;
    padding: 11px 14px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: white;
    text-align: left;
    width: calc(100% - 32px);
}

.stb-ai-banner[dir="rtl"],
[dir="rtl"] .stb-ai-banner {
    text-align: right;
}

.stb-ai-banner:hover {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(139, 92, 246, 0.1));
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
}

.stb-ai-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

.stb-ai-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stb-ai-text strong {
    font-size: 0.8rem;
    font-weight: 700;
}

.stb-ai-text small {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 500;
}

.stb-ai-arrow {
    color: #a78bfa;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.stb-ai-banner:hover .stb-ai-arrow { transform: translateX(3px); }
[dir="rtl"] .stb-ai-banner:hover .stb-ai-arrow { transform: translateX(-3px); }

/* Section Label */
.stb-section-label {
    padding: 10px 22px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Strategy Grid — compact, tight */
.stb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px 16px 12px;
}

/* Strategy Card — compact pill style */
.stb-strategy-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    color: white;
    position: relative;
    overflow: hidden;
}

.stb-strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--card-gradient);
    opacity: 0;
    transition: opacity 0.25s;
}

.stb-strategy-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--card-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--card-color);
}

.stb-strategy-card:hover::before { opacity: 1; }

.stb-strategy-card:active {
    transform: translateY(-1px) scale(0.97);
}

/* Card Icon — smaller */
.stb-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
    transition: transform 0.25s, box-shadow 0.25s;
}

.stb-strategy-card:hover .stb-card-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Card Label — tighter */
.stb-card-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: #b0bec5;
    text-align: center;
    line-height: 1.25;
    transition: color 0.25s;
    max-width: 100%;
    word-break: break-word;
}

.stb-strategy-card:hover .stb-card-label {
    color: white;
}

/* Custom Card Delete */
.stb-delete-custom {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 0.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

[dir="rtl"] .stb-delete-custom { right: auto; left: 4px; }
.stb-custom-card:hover .stb-delete-custom { display: flex; }
.stb-delete-custom:hover { background: rgba(239, 68, 68, 0.4); transform: scale(1.15); }

/* Add Custom Button */
.stb-add-custom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 16px 14px;
    padding: 11px;
    width: calc(100% - 32px);
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #64748b;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.stb-add-custom-btn:hover {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.25);
    color: #a78bfa;
    transform: translateY(-1px);
}

.stb-add-custom-btn i { font-size: 0.9rem; }

/* Custom Template Creator */
.stb-custom-creator {
    margin: 0 16px 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    animation: stbSlideUp 0.3s ease;
}

.stb-custom-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.stb-custom-row:last-child { margin-bottom: 0; }

.stb-custom-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 0.82rem;
    transition: all 0.2s;
}

.stb-custom-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.stb-custom-input::placeholder { color: #475569; }

/* Color Picks */
.stb-color-picks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stb-color-pick {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.stb-color-pick:hover { transform: scale(1.15); }

.stb-color-pick.active {
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* Custom Save / Cancel Buttons */
.stb-custom-save {
    padding: 9px 18px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.stb-custom-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.stb-custom-cancel {
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.stb-custom-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* AI Loading */
.stb-ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    margin: 8px 16px 16px;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 14px;
    color: #a78bfa;
    font-weight: 600;
    font-size: 0.82rem;
}

.stb-ai-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(167, 139, 250, 0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: stbSpin 0.8s linear infinite;
}

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

/* AI Result */
.stb-ai-result {
    margin: 8px 16px 16px;
}

.stb-ai-result-card {
    background: rgba(167, 139, 250, 0.05);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 16px;
    overflow: hidden;
}

.stb-ai-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    background: rgba(167, 139, 250, 0.08);
    color: #c4b5fd;
    font-weight: 700;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(167, 139, 250, 0.1);
}

.stb-ai-result-header i { color: #a78bfa; }

.stb-ai-result-body {
    padding: 14px 16px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #e2e8f0;
}

.stb-ai-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 20px);
    margin: 4px 10px 12px;
    padding: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stb-ai-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.stb-ai-custom-apply {
    padding: 8px 16px 14px;
    text-align: center;
}

.stb-ai-custom-apply small {
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.5;
}

.stb-ai-error {
    padding: 14px 16px;
    margin: 8px 16px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .stb-modal {
        max-width: 100%;
        border-radius: 18px;
        max-height: 90vh;
    }

    .stb-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px 12px 12px;
    }

    .stb-header {
        padding: 14px 16px 12px;
    }

    .stb-strategy-card {
        padding: 10px 6px 8px;
    }

    .stb-card-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }
}
