/* VidGen.pk SaaS Platform Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: #090D16;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --bg-input: rgba(13, 18, 30, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.3);
  
  --primary: #8B5CF6;
  --primary-glow: rgba(139, 92, 246, 0.5);
  --secondary: #06B6D4;
  --accent: #EC4899;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.25);
  --backdrop: blur(16px);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Outfit', sans-serif;
}

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

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: rgba(11, 15, 25, 0.85);
  border-right: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FFF 30%, var(--primary) 70%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 0.65rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  cursor: pointer;
}

.nav-item:hover, .nav-item.active {
  color: #FFF;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.system-status-card {
  background: rgba(18, 24, 38, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.status-row:last-child {
  margin-bottom: 0;
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 32px;
  max-width: 1400px;
}

/* Top Navbar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.gpu-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.icon-pink { background: rgba(236, 72, 153, 0.15); color: var(--accent); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Main Studio Grid */
.studio-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  margin-bottom: 32px;
}

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

.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--backdrop);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #FFF;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

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

.options-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.option-card {
  background: rgba(13, 18, 30, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-card:hover, .option-card.selected {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  color: #FFF;
}

.option-card i {
  font-size: 1.3rem;
  margin-bottom: 6px;
  display: block;
}

.option-title {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Action Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Swarm Control Switches */
.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

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

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

.switch-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.switch-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-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.1);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

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

/* Live Media Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}

.media-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  position: relative;
  background: #000;
}

.media-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.gallery-body {
  padding: 16px;
}

.gallery-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--primary);
  backdrop-filter: var(--backdrop);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
