/**
 * RICH EDITOR STYLES
 * Full-featured text editor for landing pages
 */

/* =============================================================================
   TOOLBAR
   ============================================================================= */

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 35, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
}

.rich-editor-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.rich-editor-toolbar button:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.rich-editor-toolbar button:active {
    transform: translateY(0);
}

.rich-editor-toolbar select {
    height: 32px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    min-width: 100px;
}

.rich-editor-toolbar select:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.rich-editor-toolbar select option {
    background: #1a1a2e;
    color: #fff;
}

.rich-editor-toolbar select optgroup {
    background: #0f0f1a;
    color: #8b5cf6;
    font-weight: 600;
}

.rich-editor-toolbar input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
}

.rich-editor-toolbar input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.rich-editor-toolbar input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

/* =============================================================================
   SIDE PANELS
   ============================================================================= */

.rich-editor-panel {
    position: fixed;
    top: 50%;
    right: -400px;
    transform: translateY(-50%);
    width: 360px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 35, 0.99));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow: hidden;
}

.rich-editor-panel.visible {
    right: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.panel-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.panel-close:hover {
    background: rgba(239, 68, 68, 0.5);
}

.panel-content {
    padding: 1rem;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

/* Effects Panel */
.effects-panel .effect-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.effects-panel .effect-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateX(4px);
}

.effect-preview {
    display: inline-block;
}

/* Effect previews */
.effect-gradient {
    background: linear-gradient(135deg, #8b5cf6, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.effect-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.effect-neon {
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #ff00ff, 0 0 20px #ff00ff;
}

.effect-3d {
    text-shadow: 1px 1px 0 #ccc, 2px 2px 0 #bbb, 3px 3px 0 #aaa;
}

.effect-outline {
    -webkit-text-stroke: 1px currentColor;
    -webkit-text-fill-color: transparent;
}

.effect-gold {
    background: linear-gradient(to bottom, #BF953F, #FCF6BA, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Emoji Panel */
.emoji-category {
    margin-bottom: 1rem;
}

.emoji-category h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.15s;
}

.emoji-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.2);
}

/* Sections Panel */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.section-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.section-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.section-icon {
    font-size: 1.75rem;
}

.section-name {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* =============================================================================
   EDITOR CONTENT STYLES
   ============================================================================= */

.editor-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.editor-table td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    min-width: 80px;
}

.editor-table td:focus {
    outline: 2px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    margin: 1rem 0;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Text Effects Classes */
.text-effect-gradient {
    background: linear-gradient(135deg, var(--primary, #8b5cf6), var(--accent, #22d3ee));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-effect-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
}

.text-effect-neon {
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ff00ff, 0 0 40px #ff00ff;
}

.text-effect-glitch {
    position: relative;
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

.text-effect-3d {
    text-shadow: 1px 1px 0 #ccc, 2px 2px 0 #c9c9c9, 3px 3px 0 #bbb,
                 4px 4px 0 #b9b9b9, 5px 5px 0 #aaa, 6px 6px 5px rgba(0,0,0,.3);
}

.text-effect-retro {
    text-shadow: 3px 3px 0 #ff00ff, 6px 6px 0 #00ffff;
}

.text-effect-outline {
    -webkit-text-stroke: 2px currentColor;
    -webkit-text-fill-color: transparent;
}

.text-effect-shadow {
    text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
}

.text-effect-emboss {
    text-shadow: -1px -1px 1px rgba(255,255,255,.3), 1px 1px 1px rgba(0,0,0,.6);
}

.text-effect-fire {
    background: linear-gradient(to top, #ff0000, #ff6600, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255,100,0,0.5);
}

.text-effect-ice {
    background: linear-gradient(to bottom, #a8edea, #fed6e3, #d299c2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-effect-gold {
    background: linear-gradient(to bottom, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =============================================================================
   AI GENERATED SCRIPTS
   ============================================================================= */

.ai-generated-script {
    position: relative;
    width: 100%;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
}

.script-preview {
    width: 100%;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */

.editor-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 35, 0.99));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    z-index: 2000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .rich-editor-toolbar {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
    }
    
    .toolbar-divider {
        display: none;
    }
    
    .rich-editor-toolbar button {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .rich-editor-toolbar select {
        height: 28px;
        min-width: 80px;
        font-size: 0.7rem;
    }
    
    .rich-editor-panel {
        width: calc(100vw - 40px);
        right: -100vw;
    }
    
    .rich-editor-panel.visible {
        right: 20px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .sections-grid {
        grid-template-columns: 1fr;
    }
}








