/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Panels */
.editor-panel,
.preview-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-panel h2,
.preview-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #fff;
    border-bottom: 2px solid rgba(102, 126, 234, 0.5);
    padding-bottom: 0.5rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.form-section h3 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Redact Options */
.redact-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.redact-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.redact-option label {
    display: inline;
    font-size: 0.85rem;
    color: #ff6b6b;
    margin-bottom: 0;
}

/* Hidden fields */
.hidden {
    display: none;
}

.quote-fields,
.second-email-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.actions {
    margin-top: 1rem;
}

.help-text {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.8rem;
}

/* Preview Panel */
.preview-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
    max-height: 80vh;
}

/* Email Preview - Matching the exact Epstein email style */
.email-preview {
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
    background: #fff;
    padding: 10px;
    position: relative;
    cursor: crosshair;
    min-height: 200px;
}

.email-header {
    margin-bottom: 15px;
}

.email-header-line {
    margin-bottom: 2px;
    position: relative;
}

.email-header-line .label {
    font-weight: bold;
    color: #000;
}

.email-header-line .value {
    color: #000;
}

.email-header-line .email-link {
    color: #0000EE;
    text-decoration: underline;
}

.email-body {
    margin-top: 15px;
    white-space: pre-wrap;
}

.email-quote {
    margin-top: 20px;
}

.quote-header {
    margin-bottom: 10px;
}

.quote-body {
    white-space: pre-wrap;
}

.signature {
    margin-top: 15px;
    font-style: normal;
}

.email-separator {
    height: 30px;
}

.second-email {
    margin-top: 10px;
}

/* Redaction Styles */
.redaction {
    display: inline-block;
    background: #000;
    height: 1em;
    vertical-align: middle;
}

.redaction-small {
    width: 100px;
}

.redaction-medium {
    width: 200px;
}

.redaction-large {
    width: 300px;
}

.redaction-inline {
    display: inline-block;
    background: #000;
    color: #000;
    padding: 0 5px;
}

/* Custom redaction boxes that can be placed anywhere */
.custom-redaction {
    position: absolute;
    background: #000;
    cursor: pointer;
    min-width: 20px;
    min-height: 14px;
}

.custom-redaction:hover {
    outline: 2px solid #ff6b6b;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 2px;
}

.resize-handle.se {
    right: -4px;
    bottom: -4px;
    cursor: se-resize;
}

/* Inline value with optional redaction */
.inline-with-redaction {
    display: inline;
}
