/* Newsletter Blog - Main Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

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

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

/* Header */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

/* Main */
.main {
    min-height: calc(100vh - 120px);
    padding: 24px 0;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Email Cards */
.email-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.email-card {
    background: var(--card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.email-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.email-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.newsletter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.email-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.email-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.email-title a {
    color: var(--text);
    text-decoration: none;
}

.email-title a:hover {
    color: var(--primary);
}

.email-original {
    color: var(--text-light);
    font-size: 0.875rem;
    font-style: italic;
}

.email-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

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

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

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

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

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--card);
    border-radius: 8px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-bottom: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-translated { background: #dbeafe; color: #1e40af; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Console */
.console-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 24px;
}

.console-sidebar {
    background: var(--card);
    border-radius: 8px;
    padding: 16px;
}

.console-menu {
    list-style: none;
}

.console-menu li {
    margin-bottom: 4px;
}

.console-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
}

.console-menu a:hover,
.console-menu a.active {
    background: var(--bg);
    color: var(--primary);
}

/* Task Status */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg);
    border-radius: 6px;
}

.task-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Email Detail */
.email-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.email-detail-header {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.email-detail-title {
    font-size: 1.75rem;
    margin: 16px 0;
    line-height: 1.4;
}

.email-content {
    line-height: 1.8;
    font-size: 16px;
}

.email-content h2 {
    margin: 32px 0 16px;
    font-size: 1.35rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.email-content h3 {
    margin: 24px 0 12px;
    font-size: 1.15rem;
}

.email-content h3 a {
    color: var(--text);
    text-decoration: none;
}

.email-content h3 a:hover {
    color: var(--primary);
}

.email-content p {
    margin-bottom: 16px;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
    align-items: center;
}

.copy-status {
    margin-left: 12px;
    font-size: 0.875rem;
}

.copy-status.success {
    color: var(--success);
}

.copy-status.error {
    color: var(--error);
}

.copy-status.warning {
    color: var(--warning);
}

/* Footer */
.footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 20px;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
    }
    
    .email-grid {
        grid-template-columns: 1fr;
    }
    
    .console-grid {
        grid-template-columns: 1fr;
    }
}
