/* Email Newsletter Preview — custom styles */

/* Layout */
.tool-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .tool-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Input section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
    display: block;
    margin-bottom: 0.25rem;
}

.input-section textarea {
    width: 100%;
    min-height: 280px;
    padding: 0.75rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    resize: vertical;
    background: #f9fafb;
    color: #111827;
    box-sizing: border-box;
}

.input-section textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Controls row */
.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.controls button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    background: #2563eb;
    color: #fff;
    transition: background 0.2s;
}

.controls button:hover {
    background: #1d4ed8;
}

.controls button.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e0e6ed;
}

.controls button.secondary:hover {
    background: #e5e7eb;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

/* Error message */
.error-message {
    display: none;
    padding: 0.6rem 0.9rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.875rem;
}

/* Preview section */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-pane {
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e0e6ed;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.badge {
    background: #2563eb;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.preview-container {
    overflow: auto;
    max-height: 400px;
}

.preview-desktop .preview-container {
    width: 100%;
}

.preview-mobile .preview-container {
    max-width: 320px;
    margin: 0 auto;
}

.email-preview {
    padding: 0.5rem;
    min-height: 200px;
    font-size: 0.875rem;
}

/* Dark mode */
html[data-theme="dark"] .section-label {
    color: #f9fafb;
}

html[data-theme="dark"] .input-section textarea {
    background: #1f2937;
    color: #f9fafb;
    border-color: #374151;
}

html[data-theme="dark"] .controls button.secondary {
    background: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

html[data-theme="dark"] .controls button.secondary:hover {
    background: #4b5563;
}

html[data-theme="dark"] .error-message {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

html[data-theme="dark"] .preview-pane {
    background: #1f2937;
    border-color: #374151;
}

html[data-theme="dark"] .preview-header {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}
