* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 0;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
}

header .subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--text);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #f8fafc;
}

.upload-content .upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.upload-content p {
    color: var(--text-light);
}

.upload-content .small {
    font-size: 0.875rem;
    margin-top: 5px;
}

.hint {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 10px;
}

.file-info {
    margin-top: 15px;
    padding: 12px;
    background: #f0fdf4;
    border-radius: 6px;
    color: var(--success);
}

/* Recipients */
.recipients-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.recipients-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.empty-state {
    color: var(--text-light);
    text-align: center;
    padding: 20px;
}

.recipient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 6px;
}

.recipient-item:last-child {
    margin-bottom: 0;
}

.recipient-item .email {
    font-family: monospace;
}

.recipient-item .remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--secondary);
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
}

/* Progress Section */
.progress-bar {
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 500;
}

.progress-details {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat.success {
    background: #f0fdf4;
    color: var(--success);
}

.stat.failed {
    background: #fef2f2;
    color: var(--danger);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.log-container h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.log {
    max-height: 200px;
    overflow-y: auto;
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.875rem;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px 0;
    border-bottom: 1px solid #334155;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    color: #4ade80;
}

.log-entry.error {
    color: #f87171;
}

.log-entry .time {
    color: #94a3b8;
    margin-right: 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 20px;
}

.preview-field {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.preview-content {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .progress-details {
        flex-direction: column;
    }
}
