/* ========================================================
   Shortly Admin Panel - Modern Editorial Design System
   ======================================================== */

:root {
  --primary: #E53935;
  --primary-hover: #D32F2F;
  --primary-light: #FFEBEE;
  --bg-main: #F4F6F9;
  --bg-card: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-active: #E53935;
  --success: #10B981;
  --warning: #F59E0B;
  --info: #0284C7;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-badge {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  font-family: Georgia, serif;
}

.brand-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #475569;
  padding: 12px 14px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  margin-bottom: 3px;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #fff;
  background: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.35);
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

.admin-meta .name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.admin-meta .role {
  font-size: 11px;
  color: var(--sidebar-text);
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 4px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.red { background: #FFEBEE; color: #E53935; }
.stat-icon.blue { background: #E0F2FE; color: #0284C7; }
.stat-icon.green { background: #DCFCE7; color: #16A34A; }
.stat-icon.purple { background: #F3E8FF; color: #9333EA; }

/* Content Cards & Tables */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

.card-body {
  padding: 24px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-google {
  background: #E8F0FE;
  color: #1A73E8;
  border: 1px solid rgba(66, 133, 244, 0.3);
}

.badge-email {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid var(--border);
}

.badge-active {
  background: #DEF7EC;
  color: #03543F;
}

.badge-suspended {
  background: #FDE8E8;
  color: #9B1C1C;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(229,57,53,0.3);
}

.btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #E2E8F0;
}

.btn-danger {
  background: #EF4444;
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Word counter badge */
.word-counter-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #F1F5F9;
  color: #475569;
  display: inline-block;
  margin-top: 4px;
}

.word-counter-pill.ideal {
  background: #DCFCE7;
  color: #15803D;
}

.word-counter-pill.warning {
  background: #FEF3C7;
  color: #B45309;
}

/* Real-time Phone Card Mockup */
.mockup-preview-container {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.phone-mockup {
  width: 330px;
  background: #000;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  border: 4px solid #1E293B;
}

.phone-screen {
  background: #F8F9FA;
  border-radius: 28px;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.phone-card {
  margin: 12px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.phone-card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #E2E8F0;
  display: block;
}

.phone-card-body {
  padding: 14px;
}

.phone-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.phone-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  line-height: 1.3;
}

.phone-card-summary {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.phone-source-tag {
  font-size: 10px;
  font-weight: 600;
  color: #94A3B8;
  margin-top: 10px;
  text-transform: uppercase;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 20px;
  background: #F8FAFC;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
