/**
 * AI Prompt Box Pro - Frontend Styles
 * Beautiful, modern prompt boxes with copy functionality
 */

/* ========================================
   CSS Variables & Base Styles
   ======================================== */
:root {
    --aipb-primary: #6366f1;
    --aipb-primary-dark: #4f46e5;
    --aipb-success: #10b981;
    --aipb-bg-light: #f8fafc;
    --aipb-border: #e2e8f0;
    --aipb-text: #1e293b;
    --aipb-text-muted: #64748b;
    --aipb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --aipb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --aipb-radius: 16px;
    --aipb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Main Container - Default Style
   ======================================== */
.ai-prompt-box {
    position: relative;
    margin: 2rem 0;
    border-radius: var(--aipb-radius);
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

.ai-prompt-box *,
.ai-prompt-box *::before,
.ai-prompt-box *::after {
    box-sizing: border-box;
}

/* Default Style */
.ai-prompt-default {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    border: 1px solid var(--aipb-border);
    box-shadow: var(--aipb-shadow);
}

.ai-prompt-default:hover {
    box-shadow: var(--aipb-shadow-lg);
    transform: translateY(-2px);
    transition: var(--aipb-transition);
}

/* ========================================
   Header Section
   ======================================== */
.ai-prompt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-prompt-default .ai-prompt-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-prompt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.ai-prompt-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.ai-prompt-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ========================================
   Copy Button
   ======================================== */
.ai-prompt-copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    transition: var(--aipb-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-prompt-copy-btn:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-prompt-copy-btn:active {
    transform: scale(0.98);
}

.ai-prompt-copy-btn svg {
    width: 18px;
    height: 18px;
}

.ai-prompt-copy-btn .check-icon {
    display: none;
    color: var(--aipb-success);
}

.ai-prompt-copy-btn.copied .copy-icon {
    display: none;
}

.ai-prompt-copy-btn.copied .check-icon {
    display: block;
    animation: aipb-scale-in 0.3s ease;
}

.ai-prompt-copy-btn.copied {
    background: #ecfdf5;
    color: var(--aipb-success);
}

.ai-prompt-copy-btn.copied .copy-text::after {
    content: 'ied!';
}

.ai-prompt-copy-btn.copied .copy-text {
    font-size: 0;
}

.ai-prompt-copy-btn.copied .copy-text::after {
    font-size: 14px;
    content: 'Copied!';
}

/* ========================================
   Content Section
   ======================================== */
.ai-prompt-content {
    padding: 24px;
    background: #fff;
}

.ai-prompt-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--aipb-text);
    word-break: break-word;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: linear-gradient(135deg, #fafbfc 0%, #f0f2f5 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--aipb-primary);
}

/* ========================================
   Toast Notification
   ======================================== */
.ai-prompt-toast {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: var(--aipb-transition);
    z-index: 100;
}

.ai-prompt-toast svg {
    width: 20px;
    height: 20px;
}

.ai-prompt-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    animation: aipb-bounce-in 0.5s ease;
}

/* ========================================
   Style: Dark
   ======================================== */
.ai-prompt-dark {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.ai-prompt-dark .ai-prompt-header {
    background: linear-gradient(135deg, #2d2d44 0%, #3d3d5c 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-prompt-dark .ai-prompt-content {
    background: #1e1e2e;
}

.ai-prompt-dark .ai-prompt-text {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #818cf8;
}

.ai-prompt-dark .ai-prompt-copy-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    backdrop-filter: blur(10px);
}

.ai-prompt-dark .ai-prompt-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ai-prompt-dark .ai-prompt-copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* ========================================
   Style: Gradient
   ======================================== */
.ai-prompt-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border: none;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    padding: 3px;
}

.ai-prompt-gradient .ai-prompt-header {
    background: transparent;
    border-bottom: none;
}

.ai-prompt-gradient .ai-prompt-content {
    background: #fff;
    border-radius: 0 0 13px 13px;
    margin: 0;
}

.ai-prompt-gradient .ai-prompt-text {
    background: linear-gradient(135deg, #fdf4ff 0%, #f5f3ff 100%);
    border-left-color: #a855f7;
}

/* ========================================
   Style: Neon
   ======================================== */
.ai-prompt-neon {
    background: #0a0a0f;
    border: 2px solid #00ff88;
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.3),
        0 0 40px rgba(0, 255, 136, 0.1),
        inset 0 0 60px rgba(0, 255, 136, 0.05);
}

.ai-prompt-neon .ai-prompt-header {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 200, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.ai-prompt-neon .ai-prompt-icon {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.ai-prompt-neon .ai-prompt-icon svg {
    color: #00ff88;
}

.ai-prompt-neon .ai-prompt-label {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.ai-prompt-neon .ai-prompt-content {
    background: #0a0a0f;
}

.ai-prompt-neon .ai-prompt-text {
    color: #e0ffe0;
    background: rgba(0, 255, 136, 0.05);
    border-left-color: #00ff88;
    text-shadow: 0 0 1px rgba(0, 255, 136, 0.3);
}

.ai-prompt-neon .ai-prompt-copy-btn {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.ai-prompt-neon .ai-prompt-copy-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.ai-prompt-neon .ai-prompt-copy-btn.copied {
    background: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.ai-prompt-neon .ai-prompt-toast {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #0a0a0f;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

/* ========================================
   Style: Minimal
   ======================================== */
.ai-prompt-minimal {
    background: #fff;
    border: 2px dashed #cbd5e1;
    box-shadow: none;
    border-radius: 12px;
}

.ai-prompt-minimal:hover {
    border-color: var(--aipb-primary);
    box-shadow: none;
    transform: none;
}

.ai-prompt-minimal .ai-prompt-header {
    background: #f8fafc;
    border-bottom: 2px dashed #e2e8f0;
    padding: 12px 16px;
}

.ai-prompt-minimal .ai-prompt-icon {
    background: var(--aipb-primary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.ai-prompt-minimal .ai-prompt-label {
    color: var(--aipb-text);
    font-size: 13px;
    text-transform: none;
    font-weight: 500;
}

.ai-prompt-minimal .ai-prompt-content {
    padding: 20px;
}

.ai-prompt-minimal .ai-prompt-text {
    background: transparent;
    padding: 0;
    border-left: none;
    font-family: inherit;
    font-size: 15px;
}

.ai-prompt-minimal .ai-prompt-copy-btn {
    padding: 8px 14px;
    background: var(--aipb-primary);
    color: #fff;
    font-size: 13px;
}

.ai-prompt-minimal .ai-prompt-copy-btn:hover {
    background: var(--aipb-primary-dark);
}

/* ========================================
   Style: Glass (NEW)
   ======================================== */
.ai-prompt-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.ai-prompt-glass .ai-prompt-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-prompt-glass .ai-prompt-icon {
    background: rgba(255, 255, 255, 0.3);
}

.ai-prompt-glass .ai-prompt-content {
    background: rgba(255, 255, 255, 0.9);
}

.ai-prompt-glass .ai-prompt-text {
    background: rgba(255, 255, 255, 0.5);
    border-left-color: #667eea;
}

.ai-prompt-glass .ai-prompt-copy-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

/* ========================================
   Style: Retro (NEW)
   ======================================== */
.ai-prompt-retro {
    background: #fef3c7;
    border: 4px solid #92400e;
    border-radius: 0;
    box-shadow: 8px 8px 0 #92400e;
}

.ai-prompt-retro:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 #92400e;
}

.ai-prompt-retro .ai-prompt-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-bottom: 4px solid #92400e;
    border-radius: 0;
}

.ai-prompt-retro .ai-prompt-icon {
    background: #92400e;
    border-radius: 0;
}

.ai-prompt-retro .ai-prompt-label {
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ai-prompt-retro .ai-prompt-content {
    background: #fef3c7;
}

.ai-prompt-retro .ai-prompt-text {
    background: #fffbeb;
    border-left: 4px solid #92400e;
    border-radius: 0;
    font-family: 'Courier New', monospace;
}

.ai-prompt-retro .ai-prompt-copy-btn {
    background: #92400e;
    color: #fef3c7;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-prompt-retro .ai-prompt-copy-btn:hover {
    background: #78350f;
    transform: none;
}

.ai-prompt-retro .ai-prompt-toast {
    border-radius: 0;
    background: #92400e;
}

/* ========================================
   Style: Cyberpunk (NEW)
   ======================================== */
.ai-prompt-cyberpunk {
    background: #0f0f23;
    border: 2px solid;
    border-image: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff) 1;
    box-shadow: 
        0 0 30px rgba(255, 0, 110, 0.3),
        0 0 60px rgba(131, 56, 236, 0.2);
    position: relative;
}

.ai-prompt-cyberpunk::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff);
    z-index: -1;
    filter: blur(10px);
    opacity: 0.5;
}

.ai-prompt-cyberpunk .ai-prompt-header {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.2) 0%, rgba(131, 56, 236, 0.2) 50%, rgba(58, 134, 255, 0.2) 100%);
    border-bottom: 1px solid rgba(255, 0, 110, 0.5);
}

.ai-prompt-cyberpunk .ai-prompt-icon {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    animation: aipb-pulse-glow 2s infinite;
}

.ai-prompt-cyberpunk .ai-prompt-icon svg {
    color: #fff;
}

.ai-prompt-cyberpunk .ai-prompt-label {
    background: linear-gradient(90deg, #ff006e, #8338ec, #3a86ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: none;
}

.ai-prompt-cyberpunk .ai-prompt-content {
    background: #0f0f23;
}

.ai-prompt-cyberpunk .ai-prompt-text {
    color: #e0e0ff;
    background: rgba(255, 0, 110, 0.05);
    border-left: 4px solid #ff006e;
}

.ai-prompt-cyberpunk .ai-prompt-copy-btn {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    color: #fff;
    border: none;
}

.ai-prompt-cyberpunk .ai-prompt-copy-btn:hover {
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

.ai-prompt-cyberpunk .ai-prompt-toast {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

@keyframes aipb-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 0, 110, 0.8), 0 0 40px rgba(131, 56, 236, 0.5);
    }
}

/* ========================================
   Style: Pastel (NEW)
   ======================================== */
.ai-prompt-pastel {
    background: linear-gradient(135deg, #fce7f3 0%, #ddd6fe 50%, #cffafe 100%);
    border: 2px solid #f9a8d4;
    box-shadow: 0 10px 40px rgba(249, 168, 212, 0.3);
}

.ai-prompt-pastel:hover {
    box-shadow: 0 15px 50px rgba(249, 168, 212, 0.4);
}

.ai-prompt-pastel .ai-prompt-header {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #06b6d4 100%);
    border-bottom: none;
}

.ai-prompt-pastel .ai-prompt-icon {
    background: rgba(255, 255, 255, 0.4);
}

.ai-prompt-pastel .ai-prompt-content {
    background: rgba(255, 255, 255, 0.7);
}

.ai-prompt-pastel .ai-prompt-text {
    background: rgba(255, 255, 255, 0.5);
    border-left-color: #ec4899;
    color: #6b21a8;
}

.ai-prompt-pastel .ai-prompt-copy-btn {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #fff;
}

.ai-prompt-pastel .ai-prompt-toast {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

/* ========================================
   AI Preset Styles
   ======================================== */
.ai-prompt-preset .ai-prompt-header {
    background: linear-gradient(135deg, var(--aipb-preset-primary, #667eea) 0%, var(--aipb-preset-secondary, #764ba2) 100%);
}

/* ========================================
   Animations
   ======================================== */
@keyframes aipb-scale-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes aipb-bounce-in {
    0% {
        transform: translateX(-50%) translateY(100px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-10px) scale(1.05);
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes aipb-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .ai-prompt-box {
        margin: 1.5rem 0;
        border-radius: 12px;
    }
    
    .ai-prompt-header {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .ai-prompt-icon {
        width: 32px;
        height: 32px;
    }
    
    .ai-prompt-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .ai-prompt-label {
        font-size: 13px;
    }
    
    .ai-prompt-copy-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .ai-prompt-copy-btn .copy-text {
        display: none;
    }
    
    .ai-prompt-copy-btn.copied .copy-text::after {
        display: none;
    }
    
    .ai-prompt-content {
        padding: 16px;
    }
    
    .ai-prompt-text {
        font-size: 14px;
        padding: 16px;
    }
    
    .ai-prompt-toast {
        font-size: 13px;
        padding: 12px 20px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .ai-prompt-header {
        gap: 8px;
    }
    
    .ai-prompt-copy-btn {
        padding: 8px 12px;
    }
    
    .ai-prompt-text {
        font-size: 13px;
        padding: 14px;
        line-height: 1.6;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .ai-prompt-box {
        box-shadow: none;
        border: 2px solid #000;
        break-inside: avoid;
    }
    
    .ai-prompt-copy-btn {
        display: none;
    }
    
    .ai-prompt-toast {
        display: none;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.ai-prompt-copy-btn:focus {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

.ai-prompt-copy-btn:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .ai-prompt-box,
    .ai-prompt-copy-btn,
    .ai-prompt-toast {
        transition: none;
        animation: none;
    }
    
    .ai-prompt-default:hover {
        transform: none;
    }
    
    .ai-prompt-cyberpunk .ai-prompt-icon {
        animation: none;
    }
}

/* ========================================
   Dark Mode Auto Detection
   ======================================== */
@media (prefers-color-scheme: dark) {
    .ai-prompt-default {
        background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .ai-prompt-default .ai-prompt-content {
        background: #1e1e2e;
    }
    
    .ai-prompt-default .ai-prompt-text {
        color: #e2e8f0;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .ai-prompt-minimal {
        background: #1e1e2e;
        border-color: #4b5563;
    }
    
    .ai-prompt-minimal .ai-prompt-header {
        background: #2d2d44;
    }
    
    .ai-prompt-minimal .ai-prompt-label {
        color: #e2e8f0;
    }
    
    .ai-prompt-minimal .ai-prompt-content {
        background: #1e1e2e;
    }
    
    .ai-prompt-minimal .ai-prompt-text {
        color: #e2e8f0;
    }
}
