/* ULX Magazine Enhanced Rich Text Editor Styles - 2025 Edition */

.ulx-editor {
    border: 2px solid #333;
    border-radius: 12px;
    background: #0a0a0a;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin: 20px 0;
    position: relative;
    transition: all 0.3s ease;
}

.ulx-editor:hover {
    box-shadow: 0 12px 40px rgba(0, 122, 204, 0.2);
}

.ulx-editor.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    border-radius: 0;
    margin: 0;
}

/* Enhanced Toolbar */
.ulx-editor-toolbar {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-bottom: 1px solid #333;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.toolbar-group:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toolbar-separator {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, #555, transparent);
    margin: 0 12px;
}

.toolbar-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.toolbar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.toolbar-btn:hover::before {
    left: 100%;
}

.toolbar-btn:hover {
    background: #444;
    border-color: #007acc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.toolbar-btn:active,
.toolbar-btn.active {
    background: linear-gradient(135deg, #007acc, #0099ff);
    border-color: #00aaff;
    color: #fff;
    transform: translateY(0);
}

.toolbar-btn i {
    font-size: 16px;
}

/* AI Assistant Button */
.toolbar-btn[data-command="ai-assist"] {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #7c3aed;
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* Voice Button */
.toolbar-btn[data-command="voice-to-text"].active {
    background: linear-gradient(135deg, #ef4444, #f87171);
    animation: recording-pulse 1s infinite;
}

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

/* Enhanced Content Area */
.ulx-editor-content {
    min-height: 400px;
    max-height: 700px;
    overflow-y: auto;
    padding: 24px;
    background: #0a0a0a;
    color: #e8e8e8;
    font-size: 16px;
    line-height: 1.7;
    outline: none;
    font-family: 'Georgia', serif;
    scroll-behavior: smooth;
}

.ulx-editor-content:empty:before {
    content: attr(data-placeholder);
    color: #666;
    font-style: italic;
    opacity: 0.7;
}

.ulx-editor-content:focus {
    background: #111;
}

/* Enhanced Content Formatting */
.ulx-editor-content h1,
.ulx-editor-content h2,
.ulx-editor-content h3 {
    color: #fff;
    margin: 2em 0 1em 0;
    font-weight: 700;
    line-height: 1.3;
    position: relative;
}

.ulx-editor-content h1 {
    font-size: 2.8em;
    background: linear-gradient(135deg, #007acc, #00aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 3px solid #007acc;
    padding-bottom: 12px;
}

.ulx-editor-content h2 {
    font-size: 2.2em;
    border-bottom: 2px solid #555;
    padding-bottom: 8px;
}

.ulx-editor-content h3 {
    font-size: 1.8em;
    color: #00aaff;
}

.ulx-editor-content p {
    margin: 1.2em 0;
    text-align: justify;
}

.ulx-editor-content blockquote {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
    border-left: 5px solid #007acc;
    margin: 2em 0;
    padding: 20px 24px;
    font-style: italic;
    color: #ccc;
    border-radius: 0 8px 8px 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ulx-editor-content blockquote::before {
    content: '"';
    font-size: 4em;
    color: #007acc;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

/* Table Styles */
.editor-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.editor-table th,
.editor-table td {
    border: 1px solid #444;
    padding: 12px 16px;
    text-align: left;
    transition: background 0.2s ease;
}

.editor-table th {
    background: linear-gradient(135deg, #333, #2a2a2a);
    color: #fff;
    font-weight: 600;
}

.editor-table tr:nth-child(even) {
    background: #1a1a1a;
}

.editor-table tr:hover {
    background: #333;
}

/* Special Elements */
.highlight {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #000 !important;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.mention {
    color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
}

.hashtag {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
}

.embed-container {
    margin: 1.5em 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #333;
}

/* Enhanced Status Bar */
.ulx-editor-status {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border-top: 1px solid #333;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #aaa;
    flex-wrap: wrap;
    gap: 16px;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-center {
    justify-content: center;
}

.ulx-editor-status span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.ulx-editor-status span:hover {
    background: rgba(255, 255, 255, 0.05);
}

.seo-score .score {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    background: #dc3545;
    color: white;
    font-size: 11px;
}

.seo-score .score[data-score="high"] {
    background: #28a745;
}

.seo-score .score[data-score="medium"] {
    background: #ffc107;
    color: #000;
}

.status-btn {
    background: #333;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.status-btn:hover {
    background: #444;
    color: #fff;
    border-color: #007acc;
}

/* AI Panel */
/* AI Panel Styles */
.ai-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 350px;
    max-height: 80vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    z-index: 1001;
    border: 2px solid #e1e8ed;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.ai-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-ai-panel {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-ai-panel:hover {
    background-color: rgba(255,255,255,0.2);
}

.ai-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

.ai-suggestions {
    margin-bottom: 20px;
}

.ai-suggestions h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.suggestion-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    min-height: 40px;
    border: 1px solid #e9ecef;
}

.ai-tools {
    margin-bottom: 20px;
}

.ai-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.ai-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    min-height: 44px;
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-btn:active {
    transform: translateY(0);
}

.ai-btn i {
    font-size: 12px;
    opacity: 0.9;
}

.ai-prompt {
    margin-bottom: 15px;
}

.ai-prompt textarea {
    width: 100%;
    height: 80px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.ai-prompt textarea:focus {
    outline: none;
    border-color: #667eea;
}

.ai-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ai-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.ai-tips {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
    margin-top: 15px;
}

.ai-tips small {
    color: #555;
    font-size: 12px;
    line-height: 1.4;
}

.ai-tips i {
    color: #2196f3;
    margin-right: 4px;
}

/* AI Suggestion Display */
.ai-suggestion-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    animation: fadeInUp 0.3s ease;
}

.ai-suggestion-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-suggestion-content {
    color: #666;
    line-height: 1.5;
    white-space: pre-line;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness for AI panel */
@media (max-width: 768px) {
    .ai-panel {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .ai-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-btn {
        font-size: 13px;
        padding: 12px;
    }
}

/* SEO Panel */
.seo-panel {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 320px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.seo-header {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seo-score-circle {
    text-align: center;
    margin: 20px 0;
}

.score-number {
    font-size: 3em;
    font-weight: bold;
    color: #007acc;
    line-height: 1;
}

.score-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.seo-checks {
    margin: 16px 0;
}

.seo-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    transition: color 0.2s ease;
}

/* Analytics Panel */
.analytics-panel {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 400px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.analytics-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
}

.metric {
    text-align: center;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 8px;
}

.metric-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #007acc;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Social Preview Panel */
.social-preview-panel {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 380px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.social-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.platform-tabs {
    display: flex;
    border-bottom: 1px solid #333;
}

.platform-tab {
    flex: 1;
    background: #2a2a2a;
    border: none;
    color: #aaa;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
}

.platform-tab.active,
.platform-tab:hover {
    background: #007acc;
    color: white;
}

.preview-container {
    padding: 20px;
}

.tweet-preview {
    background: #000;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 16px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Collaboration Panel */
.collaboration-panel {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 350px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.collab-header {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .ulx-editor-toolbar {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .toolbar-btn {
        padding: 8px 10px;
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .toolbar-separator {
        height: 24px;
        margin: 0 8px;
    }
    
    .ulx-editor-content {
        padding: 20px 16px;
        font-size: 15px;
        min-height: 300px;
    }
    
    .ulx-editor-status {
        padding: 10px 16px;
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .status-left,
    .status-center,
    .status-right {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .ai-panel,
    .seo-panel,
    .analytics-panel,
    .social-preview-panel,
    .collaboration-panel {
        width: 90vw;
        right: 5vw;
        max-width: 350px;
    }
}

/* Dark/Light Theme Toggle */
.ulx-editor[data-theme="light"] {
    background: #ffffff;
    border-color: #e5e5e5;
}

.ulx-editor[data-theme="light"] .ulx-editor-toolbar {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.ulx-editor[data-theme="light"] .ulx-editor-content {
    background: #ffffff;
    color: #333;
}

/* Accessibility Improvements */
.toolbar-btn:focus,
.status-btn:focus {
    outline: 2px solid #007acc;
    outline-offset: 2px;
}

.ulx-editor-content:focus {
    box-shadow: inset 0 0 0 2px rgba(0, 122, 204, 0.3);
}

/* Smooth Animations */
* {
    transition: all 0.2s ease;
}

/* Print Styles */
@media print {
    .ulx-editor-toolbar,
    .ulx-editor-status,
    .ai-panel,
    .seo-panel,
    .analytics-panel,
    .social-preview-panel,
    .collaboration-panel {
        display: none !important;
    }
    
    .ulx-editor {
        border: none;
        box-shadow: none;
        background: white;
    }
    
    .ulx-editor-content {
        background: white;
        color: black;
        padding: 0;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }
}
