/* Shronix Marketing Pro - Main Stylesheet */
/* Light Modern Theme */

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

:root {
  --bg-body: #F9FAFB;
  --bg-white: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-hover: #F3F4F6;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --text-dark: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --primary: #2563EB;
  --primary-light: #DBEAFE;
  --primary-dark: #1D4ED8;
  --success: #10B981;
  --success-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed; left: 0; top: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white;
}

.sidebar-brand-text { font-weight: 700; font-size: 16px; color: var(--text-dark); }
.sidebar-brand-sub { font-size: 11px; color: var(--text-muted); }

.sidebar-menu { padding: 16px 12px; }
.sidebar-section { margin-bottom: 8px; }
.sidebar-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-light); padding: 8px 12px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-body); font-size: 14px;
  transition: all 0.15s;
}
.sidebar-link:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text-dark);
}
.sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary-dark); font-weight: 500;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.main-content {
  flex: 1; margin-left: 260px;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-dark); }

.user-menu {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 12px; border-radius: var(--radius);
  background: var(--bg-hover);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.content { padding: 24px; flex: 1; }

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-dark); }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); }

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 12px;
}
.stat-card-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-card-icon.success { background: var(--success-light); color: var(--success); }
.stat-card-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text-dark); line-height: 1; }
.stat-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }
.btn-secondary { background: var(--bg-white); color: var(--text-dark); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-dark); margin-bottom: 6px;
}
.form-label .required { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-white);
  color: var(--text-dark);
  font-family: inherit;
  transition: all 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #065F46; }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: #991B1B; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #92400E; }
.alert-info { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* Tables */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-dark);
}
.table tr:hover { background: var(--bg-hover); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted { background: var(--bg-hover); color: var(--text-muted); }

/* Page header */
.page-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body);
  padding: 24px;
}
.auth-box {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%; max-width: 420px;
}
.auth-logo {
  width: 56px; height: 56px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.auth-title { font-size: 22px; font-weight: 700; text-align: center; color: var(--text-dark); }
.auth-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

/* Install wizard */
.install-container {
  max-width: 720px; margin: 40px auto; padding: 24px;
}
.install-header { text-align: center; margin-bottom: 32px; }
.install-logo {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.install-title { font-size: 26px; font-weight: 700; color: var(--text-dark); }
.install-subtitle { font-size: 14px; color: var(--text-muted); }

.install-steps {
  display: flex; justify-content: space-between;
  margin-bottom: 32px; padding: 0 16px;
}
.install-step {
  display: flex; flex-direction: column;
  align-items: center; flex: 1; position: relative;
}
.install-step:not(:last-child)::after {
  content: ''; position: absolute;
  top: 16px; left: 60%; width: 80%;
  height: 2px; background: var(--border);
}
.install-step.active:not(:last-child)::after,
.install-step.done:not(:last-child)::after {
  background: var(--primary);
}
.install-step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  position: relative; z-index: 2;
}
.install-step.active .install-step-number {
  background: var(--primary); color: white;
}
.install-step.done .install-step-number {
  background: var(--success); color: white;
}
.install-step-label {
  font-size: 12px; margin-top: 8px;
  color: var(--text-muted); font-weight: 500;
}
.install-step.active .install-step-label { color: var(--primary); }

.check-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.check-item:last-child { border-bottom: none; }
.check-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
}
.check-status.success { color: var(--success); }
.check-status.error { color: var(--danger); }
.check-status.pending { color: var(--text-muted); }

/* QR display */
.qr-container {
  text-align: center; padding: 32px;
}
.qr-image {
  width: 280px; height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px; background: white;
  margin: 0 auto 16px;
}
.qr-instructions {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 20px; text-align: left;
}

/* Progress bar */
.progress {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}
.progress-bar.success { background: var(--success); }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* Code blocks */
pre.code-block {
  background: #1F2937; color: #F3F4F6;
  padding: 16px; border-radius: var(--radius);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 13px; overflow-x: auto;
  position: relative;
}
.code-copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.1);
  color: white; border: none;
  padding: 4px 10px; border-radius: 4px;
  cursor: pointer; font-size: 12px;
}
.code-copy:hover { background: rgba(255,255,255,0.2); }

/* API docs specific */
.endpoint-card { margin-bottom: 20px; }
.endpoint-method {
  display: inline-block;
  padding: 4px 10px; border-radius: 4px;
  font-weight: 700; font-size: 12px;
  margin-right: 12px;
}
.method-get { background: var(--success-light); color: #065F46; }
.method-post { background: var(--primary-light); color: var(--primary-dark); }
.method-put { background: var(--warning-light); color: #92400E; }
.method-delete { background: var(--danger-light); color: #991B1B; }
.endpoint-url {
  font-family: 'Fira Code', monospace;
  font-size: 14px; color: var(--text-dark); font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-state-icon {
  width: 64px; height: 64px;
  background: var(--bg-hover);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-light);
}
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; }
.empty-state-text { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
