/* ==========================================================================
   Repeat Text — Ultra-Modern SaaS Admin Command Center
   Theme: High-End Dark Mesh Glassmorphism & Cyber Indigo Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-dark: #090D16;
  --bg-gradient: radial-gradient(circle at 15% 15%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
                 radial-gradient(circle at 85% 20%, rgba(249, 115, 22, 0.06) 0%, transparent 45%),
                 radial-gradient(circle at 50% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
                 #090D16;

  --surface-card: rgba(15, 23, 42, 0.72);
  --surface-card-hover: rgba(22, 33, 58, 0.85);
  --surface-elevated: rgba(30, 41, 59, 0.7);
  --surface-input: rgba(11, 17, 33, 0.85);

  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(14, 165, 233, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --primary: #0EA5E9;
  --primary-glow: rgba(14, 165, 233, 0.35);
  --primary-hover: #0284C7;

  --secondary: #F97316;
  --secondary-glow: rgba(249, 115, 22, 0.3);

  --accent-purple: #8B5CF6;
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning: #F59E0B;
  --danger: #EF4444;
  --danger-glow: rgba(239, 68, 68, 0.25);

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 25px rgba(14, 165, 233, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(9, 13, 22, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.4);
}

/* Header & Glass Navbar */
header {
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
  padding: 16px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  border-radius: 12px;
  box-shadow: 0 0 16px var(--primary-glow);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.3s ease;
}

.brand img:hover {
  transform: scale(1.05) rotate(-3deg);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 30%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 .badge-pro {
  font-family: var(--font-main);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(14, 165, 233, 0.5);
  -webkit-text-fill-color: #38BDF8;
  text-transform: uppercase;
}

.brand-text p {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Status Badges */
.status-badge {
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.status-badge.connected::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseGreen 2s infinite ease-in-out;
}

.status-badge.disconnected {
  background: rgba(100, 116, 139, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.status-badge.disconnected::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748B;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* User Profile in Header */
.user-profile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 6px 5px 12px;
  border-radius: 40px;
  border: 1px solid var(--border-card);
}

.avatar-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-email-text {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.08);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

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

.btn-block {
  width: 100%;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 24px 150px;
}

/* Floating Alerts / Toast Notifications */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
}

.alert-info {
  background: rgba(14, 165, 233, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15);
}

/* ==========================================================================
   Hero Stats Strip
   ========================================================================== */
.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-widget {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

.stat-widget:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-hover);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.cyan {
  background: rgba(14, 165, 233, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.stat-icon.orange {
  background: rgba(249, 115, 22, 0.15);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* ==========================================================================
   Authentication Card (Login View)
   ========================================================================== */
.auth-box {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  padding: 42px 36px;
  max-width: 450px;
  margin: 70px auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(14, 165, 233, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0EA5E9, #8B5CF6, #F97316);
}

.auth-logo-badge {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.25);
}

.auth-logo-badge img {
  border-radius: 14px;
}

.auth-box h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFF;
  margin-bottom: 8px;
}

.auth-box p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ==========================================================================
   Dashboard Grid & Cards
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.col-6 {
  grid-column: span 6;
}

.col-12 {
  grid-column: span 12;
}

@media (max-width: 1024px) {
  .col-6 {
    grid-column: span 12;
  }
}

.card {
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 26px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ==========================================================================
   Form Controls & Modern Input Styling
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-group label .label-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
}

.form-group .hint {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--surface-input);
  transition: all 0.2s ease;
  font-family: var(--font-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

.form-control[readonly] {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: default;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg2+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select.form-control option {
  background: #0F172A;
  color: #FFF;
}

/* Password Wrapper with Eye Toggle */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper .form-control {
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background-color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--primary);
  background-color: rgba(14, 165, 233, 0.1);
}

/* Copyable Input Group */
.input-with-copy {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-copy .form-control {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #E2E8F0;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.4);
  color: #38BDF8;
}

/* ==========================================================================
   Modern iOS Switch Controls
   ========================================================================== */
.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s;
}

.switch-item:last-of-type {
  border-bottom: none;
}

.switch-label-group {
  display: flex;
  flex-direction: column;
}

.switch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2px;
  background-color: #FFFFFF;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
  background: linear-gradient(135deg, #0EA5E9, #0284C7);
  box-shadow: 0 0 14px var(--primary-glow);
  border-color: rgba(14, 165, 233, 0.5);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

input:checked + .slider.secondary-slider {
  background: linear-gradient(135deg, #F97316, #EA580C);
  box-shadow: 0 0 14px var(--secondary-glow);
  border-color: rgba(249, 115, 22, 0.5);
}

input:checked + .slider.danger-slider {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 0 14px var(--danger-glow);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ==========================================================================
   AdMob Credentials Highlight Card
   ========================================================================== */
.admob-info-card {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admob-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: #38BDF8;
}

.admob-app-id-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  word-break: break-all;
}

/* ==========================================================================
   Code Preview JSON
   ========================================================================== */
.code-preview {
  background: #060911;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #38BDF8;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Sticky Bottom Floating Save Bar
   ========================================================================== */
.sticky-footer {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1200px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 99;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(14, 165, 233, 0.15);
  animation: floatUp 0.3s ease;
}

@keyframes floatUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.save-status-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.save-status-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFF;
}

.save-status-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  header {
    padding: 14px 20px;
  }
  .container {
    padding: 0 16px 120px;
  }
  .hero-stats-grid {
    grid-template-columns: 1fr;
  }
  .sticky-footer {
    width: calc(100% - 24px);
    padding: 12px 18px;
    flex-direction: column;
    gap: 12px;
  }
}
