/* BulkMailer Pro - Dark Theme Stylesheet */
:root {
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #12121f;
    --border: #2a2a4a;
    --text: #e0e0e0;
    --text-muted: #888;
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --accent: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gradient: linear-gradient(135deg, #667eea, #764ba2);
    --radius: 8px;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg-dark); color: var(--text); line-height: 1.6; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--bg-card); border-right: 1px solid var(--border); padding: 1.5rem 0; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; }
.main-content { flex: 1; margin-left: 260px; padding: 2rem; min-height: 100vh; }

/* Sidebar */
.sidebar-header { padding: 0 1.5rem 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar-header h2 { font-size: 1.3rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-header small { color: var(--text-muted); font-size: 0.75rem; }
.nav-menu { list-style: none; }
.nav-menu li a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem; color: var(--text-muted); text-decoration: none; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-menu li a:hover, .nav-menu li a.active { color: var(--text); background: rgba(102,126,234,0.1); border-left-color: var(--primary); }
.nav-menu li a .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-section { padding: 0.5rem 1.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: #555; margin-top: 1rem; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; margin-bottom: 1.5rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 1.1rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.stat-card .stat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; color: #aaa; font-size: 0.85rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.6rem 0.8rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 0.9rem; transition: border 0.3s; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(102,126,234,0.2); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group small { color: var(--text-muted); font-size: 0.75rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1.2rem; border: none; border-radius: var(--radius); font-size: 0.85rem; cursor: pointer; font-weight: 500; transition: all 0.2s; text-decoration: none; line-height: 1.5; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #333; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-block { display: block; width: 100%; text-align: center; justify-content: center; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 0.7rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
table tr:hover { background: rgba(102,126,234,0.05); }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; }
.badge-success { background: rgba(40,167,69,0.2); color: #5cff8a; }
.badge-danger { background: rgba(220,53,69,0.2); color: #ff6b7a; }
.badge-warning { background: rgba(255,193,7,0.2); color: #ffc107; }
.badge-info { background: rgba(23,162,184,0.2); color: #5dd6e8; }
.badge-secondary { background: rgba(108,117,125,0.2); color: #aaa; }

/* Alerts */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: rgba(40,167,69,0.15); border: 1px solid rgba(40,167,69,0.3); color: #5cff8a; }
.alert-danger { background: rgba(220,53,69,0.15); border: 1px solid rgba(220,53,69,0.3); color: #ff6b7a; }
.alert-warning { background: rgba(255,193,7,0.15); border: 1px solid rgba(255,193,7,0.3); color: #ffc107; }
.alert-info { background: rgba(23,162,184,0.15); border: 1px solid rgba(23,162,184,0.3); color: #5dd6e8; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.7rem 1.2rem; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 0.9rem; transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 420px; margin: 2rem; }
.login-card { background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); padding: 2rem; }
.login-header { text-align: center; margin-bottom: 1.5rem; }
.login-header h1 { font-size: 1.8rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-header p { color: var(--text-muted); margin-top: 0.3rem; }

/* Progress Bar */
.progress-bar { width: 100%; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--gradient); border-radius: 4px; transition: width 0.5s; }

/* Spam Score */
.spam-score { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--radius); font-weight: 600; }
.spam-excellent { background: rgba(40,167,69,0.2); color: #5cff8a; }
.spam-good { background: rgba(23,162,184,0.2); color: #5dd6e8; }
.spam-moderate { background: rgba(255,193,7,0.2); color: #ffc107; }
.spam-poor { background: rgba(220,53,69,0.2); color: #ff6b7a; }
.spam-critical { background: rgba(220,53,69,0.3); color: #ff4757; }

/* Editor Toolbar */
.editor-toolbar { display: flex; gap: 0.3rem; padding: 0.5rem; background: var(--bg-input); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.editor-toolbar button { background: none; border: 1px solid transparent; color: var(--text-muted); padding: 0.3rem 0.5rem; cursor: pointer; border-radius: 4px; font-size: 0.85rem; }
.editor-toolbar button:hover { background: var(--border); color: var(--text); }
.editor-content { min-height: 300px; padding: 1rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); color: var(--text); outline: none; overflow-y: auto; }
.editor-content:focus { border-color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; position: fixed; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: #5cff8a; }
.text-danger { color: #ff6b7a; }
.text-warning { color: #ffc107; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none; }

/* Toast Notifications */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; }
.toast { padding: 0.8rem 1.2rem; border-radius: var(--radius); margin-bottom: 0.5rem; animation: slideIn 0.3s ease; font-size: 0.85rem; display: flex; align-items: center; gap: 0.5rem; max-width: 350px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading Spinner */
.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); } }

/* SMTP Health Indicator */
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.5rem; }
.health-dot.healthy { background: var(--success); box-shadow: 0 0 6px rgba(40,167,69,0.5); }
.health-dot.unhealthy { background: var(--danger); box-shadow: 0 0 6px rgba(220,53,69,0.5); }
.health-dot.disabled { background: #555; }
