/* ==========================================
   Prompt Box Block - Frontend Styles
   ========================================== */


/* CSS Custom Properties (Defaults) */
.pbb-prompt-box {
    --pbb-bg: #1e2330;
    --pbb-header-bg: #272d3d;
    --pbb-title-color: #ffffff;
    --pbb-prompt-color: #5ce0d2;
    --pbb-border-radius: 12px;
    --pbb-font-mono: inherit;
    --pbb-font-sans: inherit;
    --pbb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --pbb-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.15);
    --pbb-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    --pbb-glow: 0 0 20px rgba(92, 224, 210, 0.08);
}

/* Main Container */
.pbb-prompt-box {
    position: relative;
    background: var(--pbb-bg);
    border-radius: var(--pbb-border-radius);
    overflow: hidden;
    margin: 24px 0;
    box-shadow: var(--pbb-shadow);
    transition: var(--pbb-transition);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--pbb-font-sans);
}

.pbb-prompt-box:hover {
    box-shadow: var(--pbb-shadow-hover), var(--pbb-glow);
    border-color: rgba(92, 224, 210, 0.15);
    transform: translateY(-1px);
}

/* Header */
.pbb-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--pbb-header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.pbb-prompt-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(92, 224, 210, 0.2), transparent);
}

.pbb-prompt-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pbb-prompt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(92, 224, 210, 0.1);
    border-radius: 8px;
    color: var(--pbb-prompt-color);
    transition: var(--pbb-transition);
}

.pbb-prompt-box:hover .pbb-prompt-icon {
    background: rgba(92, 224, 210, 0.15);
    transform: scale(1.05);
}

.pbb-prompt-title {
    font-weight: 600;
    color: var(--pbb-title-color);
    letter-spacing: 0.02em;
}

/* Action Buttons */
.pbb-prompt-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pbb-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: var(--pbb-transition);
    position: relative;
    overflow: hidden;
}

.pbb-action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: transparent;
    transition: var(--pbb-transition);
}

.pbb-action-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.pbb-telegram-btn:hover {
    color: #2AABEE;
}

.pbb-telegram-btn:hover::before {
    background: rgba(42, 171, 238, 0.12);
}

.pbb-whatsapp-btn:hover {
    color: #25D366;
}

.pbb-whatsapp-btn:hover::before {
    background: rgba(37, 211, 102, 0.12);
}

/* Body */
.pbb-prompt-body {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
    position: relative;
}

.pbb-prompt-text {
    flex: 1;
    min-width: 0;
}

.pbb-prompt-text pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-family: var(--pbb-font-mono);
    font-size: 14px;
    line-height: 1.7;
    color: var(--pbb-prompt-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    letter-spacing: 0.01em;
}

/* Copy Button */
.pbb-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: var(--pbb-transition);
    position: relative;
    flex-shrink: 0;
    padding: 0;
}

.pbb-copy-btn:hover {
    background: rgba(92, 224, 210, 0.1);
    border-color: rgba(92, 224, 210, 0.25);
    color: var(--pbb-prompt-color);
    transform: scale(1.08);
}

.pbb-copy-btn.pbb-copied {
    background: rgba(92, 224, 210, 0.15);
    border-color: rgba(92, 224, 210, 0.35);
    color: var(--pbb-prompt-color);
}

.pbb-copy-btn.pbb-copied .pbb-copy-icon {
    display: none;
}

.pbb-copy-btn.pbb-copied .pbb-check-icon {
    display: block !important;
    animation: pbb-check-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Copy Success Toast */
.pbb-toast {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(92, 224, 210, 0.95);
    color: #1e2330;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: var(--pbb-font-sans);
    box-shadow: 0 4px 12px rgba(92, 224, 210, 0.3);
}

.pbb-toast.pbb-toast-show {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes pbb-check-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ripple effect on copy */
.pbb-copy-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: rgba(92, 224, 210, 0.3);
    opacity: 0;
    transform: scale(0);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.pbb-copy-btn.pbb-ripple::after {
    opacity: 1;
    transform: scale(2);
    transition: transform 0s, opacity 0s;
}

/* Responsive */
@media (max-width: 600px) {
    .pbb-prompt-header {
        padding: 12px 16px;
    }

    .pbb-prompt-body {
        padding: 16px;
        gap: 12px;
    }

    .pbb-prompt-text pre {
        font-size: 13px;
    }

    .pbb-prompt-title {
        font-size: 14px;
    }

    .pbb-prompt-icon {
        width: 28px;
        height: 28px;
    }

    .pbb-action-btn {
        width: 30px;
        height: 30px;
    }

    .pbb-copy-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
}

/* Direction is now handled by the dir attribute on .pbb-prompt-box */

/* Dark mode adjustments for themes that force light backgrounds */
.pbb-prompt-box * {
    box-sizing: border-box;
}

/* Print styles */
@media print {
    .pbb-prompt-box {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .pbb-copy-btn,
    .pbb-action-btn {
        display: none;
    }
}