/* ALTERVAPE Global Styles */
:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #4ade80;
  --green-glow: rgba(34, 197, 94, 0.15);
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-hover: #222222;
  --border: #2a2a2a;
  --border-green: rgba(34,197,94,0.3);
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #6b7280;
  --red: #ef4444;
  --yellow: #eab308;
  --blue: #3b82f6;
}

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

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

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-light); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dark); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--green); color: #000; }
.btn-primary:hover { background: var(--green-light); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--green); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Inputs */
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary);
  font-size: 14px; transition: border-color 0.2s; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 2px var(--green-glow);
}
.input::placeholder { color: var(--text-muted); }
.select { appearance: none; cursor: pointer; }
.textarea { resize: vertical; min-height: 80px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-group { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-gray { background: rgba(107,114,128,0.15); color: var(--text-muted); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Toast notifications */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 400px;
  animation: slideIn 0.3s ease; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast-success { background: #052e16; border: 1px solid #166534; color: var(--green); }
.toast-error { background: #450a0a; border: 1px solid #7f1d1d; color: var(--red); }
.toast-info { background: #0c1a35; border: 1px solid #1d4ed8; color: var(--blue); }
.toast-out { animation: slideOut 0.3s ease forwards; }

/* Loading */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.6s linear infinite; }
.loading-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; border-radius: inherit; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 16px; margin-top: 8px; }

/* Image upload */
.image-drop-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 32px;
  text-align: center; cursor: pointer; transition: all 0.2s; color: var(--text-muted);
}
.image-drop-zone:hover, .image-drop-zone.drag-over { border-color: var(--green); color: var(--green); background: var(--green-glow); }
.image-preview { position: relative; width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }

/* Status dots */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }

/* Toggle switch */
.toggle { position: relative; width: 44px; height: 24px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--text-secondary); border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); background: #000; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin layout */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; min-height: 100vh; background: var(--bg-secondary);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.logo-icon { width: 36px; height: 36px; background: var(--green); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; color: #000; }
.logo-text { font-size: 16px; font-weight: 800; letter-spacing: 1px; color: var(--text-primary); }
.logo-text span { color: var(--green); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 8px 12px 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin: 2px 8px;
  border-radius: 8px; cursor: pointer; transition: all 0.15s; color: var(--text-secondary);
  font-size: 14px; font-weight: 500; border: none; background: none; width: calc(100% - 16px); text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--green-glow); color: var(--green); border: 1px solid var(--border-green); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  height: 60px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.admin-content { flex: 1; padding: 24px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-green); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon-green { background: var(--green-glow); color: var(--green); }
.stat-icon-blue { background: rgba(59,130,246,0.1); color: var(--blue); }
.stat-icon-yellow { background: rgba(234,179,8,0.1); color: var(--yellow); }
.stat-icon-red { background: rgba(239,68,68,0.1); color: var(--red); }

/* Responsive sidebar */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 99; }
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 20px; cursor: pointer; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: block; }
  .admin-content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
