/* ===========================================
   EMAIL BUILDER STYLES
   Phase 3 - SOS Storytelling
   =========================================== */

.eb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.eb-container {
    background: white;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.eb-toolbar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.eb-toolbar h2 {
    margin: 0;
    font-size: 1.1em;
}

.eb-toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.eb-toolbar-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
}

.eb-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.eb-toolbar-btn.primary {
    background: white;
    color: #667eea;
    font-weight: 600;
}

.eb-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 0 0 20px;
    line-height: 1;
}

/* Main layout */
.eb-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left panel - Blocks palette */
.eb-palette {
    width: 200px;
    background: #f8f9fa;
    border-right: 1px solid #e2e8f0;
    padding: 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

.eb-palette h3 {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eb-block-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
}

.eb-block-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateX(2px);
}

.eb-block-icon {
    font-size: 1.2em;
}

/* Templates section in palette */
.eb-templates-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.eb-template-item {
    padding: 8px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.eb-template-item:hover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

/* Center - Canvas */
.eb-canvas-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #e9ecef;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.eb-canvas {
    background: white;
    width: 600px;
    min-height: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    transition: width 0.3s;
}

.eb-canvas.mobile {
    width: 375px;
}

.eb-canvas-block {
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    cursor: pointer;
}

.eb-canvas-block:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.eb-canvas-block.selected {
    border-color: #667eea;
}

.eb-canvas-block .eb-block-actions {
    position: absolute;
    top: -12px;
    right: 4px;
    display: none;
    gap: 2px;
    z-index: 10;
}

.eb-canvas-block:hover .eb-block-actions,
.eb-canvas-block.selected .eb-block-actions {
    display: flex;
}

.eb-block-action {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eb-block-action.danger {
    background: #f56565;
}

/* Empty canvas */
.eb-empty-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
    font-size: 0.9em;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px;
}

/* Right panel - Properties */
.eb-properties {
    width: 260px;
    background: #f8f9fa;
    border-left: 1px solid #e2e8f0;
    padding: 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

.eb-properties h3 {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eb-prop-group {
    margin-bottom: 12px;
}

.eb-prop-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 4px;
}

.eb-prop-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    background: white;
}

.eb-prop-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    resize: vertical;
    min-height: 80px;
    background: white;
}

.eb-prop-color {
    width: 40px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

.eb-prop-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Variables hint */
.eb-variables {
    background: rgba(102, 126, 234, 0.06);
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.eb-variables h4 {
    margin: 0 0 6px 0;
    font-size: 0.8em;
    color: #667eea;
}

.eb-var-tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin: 2px;
    cursor: pointer;
}

.eb-var-tag:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Preview toggle */
.eb-preview-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 2px;
}

.eb-preview-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    color: white;
    background: transparent;
}

.eb-preview-btn.active {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive */
@media (max-width: 900px) {
    .eb-palette {
        width: 60px;
        padding: 10px 5px;
    }
    .eb-palette h3,
    .eb-block-item span:not(.eb-block-icon),
    .eb-templates-section {
        display: none;
    }
    .eb-block-item {
        justify-content: center;
        padding: 10px;
    }
    .eb-properties {
        width: 200px;
    }
}

@media (max-width: 600px) {
    .eb-properties {
        display: none;
    }
    .eb-canvas {
        width: 100% !important;
    }
}
