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

:root {
  --bg-deep: #07090e;
  --bg-surface: #0e1424;
  --bg-card: rgba(16, 23, 41, 0.75);
  --bg-card-hover: rgba(23, 33, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-active: rgba(0, 229, 255, 0.4);
  
  --reseller-accent: #00E5FF;
  --reseller-accent-glow: rgba(0, 229, 255, 0.25);
  --reseller-accent-hover: #00b8cc;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px var(--reseller-accent-glow);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(121, 40, 202, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--reseller-accent);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px var(--reseller-accent-glow); }
  50% { box-shadow: 0 0 30px var(--reseller-accent-glow); }
}

/* Container */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Navigation / Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--reseller-accent);
  box-shadow: 0 0 15px var(--reseller-accent-glow);
}

.brand-info h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 229, 255, 0.15);
  color: var(--reseller-accent);
  border: 1px solid var(--reseller-accent);
}

.brand-info p {
  font-size: 12px;
  color: var(--text-muted);
}

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

.credit-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 14px;
  color: var(--success);
}

.btn-add-credits {
  background: none;
  border: none;
  color: var(--success);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.btn-add-credits:hover {
  background: rgba(16, 185, 129, 0.2);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

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

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s;
  animation: fadeIn 0.4s ease-out;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.stat-content .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.stat-content .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}

/* Navigation Tabs */
.tabs-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}
.tab-btn.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--reseller-accent);
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
}

/* Tab Panels */
.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.tab-pane.active {
  display: block;
}

/* Grid Layout for Forms */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 1024px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }
}

/* Panel Card */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  margin-bottom: 24px;
}
.panel-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(7, 9, 14, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--reseller-accent);
  box-shadow: 0 0 0 3px var(--reseller-accent-glow);
  background: rgba(14, 20, 36, 0.9);
}

.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.type-btn {
  padding: 12px;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.type-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.type-btn.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--reseller-accent);
  border-color: var(--reseller-accent);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--reseller-accent) 0%, var(--reseller-accent-hover) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #050811;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px var(--reseller-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 229, 255, 0.4);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* TV Mockup Live Preview */
.tv-mockup-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-bezel-preview {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  padding: 8px;
  border: 2px solid #232d46;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--reseller-accent-glow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tv-screen-preview {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: radial-gradient(circle at center, #0e1526 0%, #030407 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  position: relative;
  transition: all 0.3s;
}

.tv-preview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tv-preview-logo-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-preview-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
}

.tv-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.tv-preview-clock {
  font-size: 11px;
  color: var(--text-dim);
}

.tv-preview-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: auto 0;
}

.tv-preview-welcome {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.tv-preview-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--reseller-accent);
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--reseller-accent);
  padding: 2px 8px;
  border-radius: 10px;
}

.tv-mockup-stand {
  width: 120px;
  height: 12px;
  background: #1e2538;
  border-radius: 0 0 6px 6px;
  margin-top: -1px;
}
.tv-mockup-base {
  width: 180px;
  height: 4px;
  background: #2a344d;
  border-radius: 2px;
  margin-top: 2px;
}

/* Devices Table */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.custom-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 18px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}
.badge-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-action-delete {
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(14, 20, 36, 0.95);
  border: 1px solid var(--reseller-accent);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Login Modal / Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}
.login-box h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.login-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Language Switcher */
.lang-switch-group {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.btn-lang {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-lang:hover {
  color: var(--text-main);
}
.btn-lang.active {
  background: var(--reseller-accent);
  color: #07090e;
  box-shadow: 0 0 10px var(--reseller-accent-glow);
}
