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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.settings-btn {
    position: absolute;
    top: 1rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: calc(100vh - 200px);
}

.left-panel, .right-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.left-panel h2, .right-panel h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.875rem;
    line-height: 1.4;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
}

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

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

.btn-success {
    background-color: #28a745;
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

.btn-danger:hover {
    background-color: #c82333;
}

.email-preview {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    min-height: 300px;
}

.email-preview-placeholder {
    padding: 2rem;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 8px 8px 0 0;
}

.email-field {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.email-field:last-child {
    margin-bottom: 0;
}

.email-body {
    padding: 1.5rem;
    white-space: pre-wrap;
    line-height: 1.6;
    min-height: 200px;
}

.rating-buttons {
    padding: 1.5rem;
    text-align: center;
    border-top: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.rating-buttons h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.rating-section {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
}

.rating-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    text-align: center;
}

.rating-buttons-static {
    text-align: center;
}

.rating-buttons-static button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rating-buttons-static button:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}

.alert {
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.htmx-indicator {
    color: #667eea;
    font-weight: 500;
    margin-left: 1rem;
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}

/* Responsive design */
@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .left-panel, .right-panel {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .settings-btn {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 1rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.api-key-input {
    font-family: monospace;
    font-size: 0.9rem;
}