:root {
  --bg-base: #05050a;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);
  
  --accent-spotify: #1ed760;
  --accent-yandex: #ffcc00;
  --accent-1: #ff0080;
  --accent-2: #7928ca;
  --accent-3: #4facfe;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
  position: relative;
}

/* Typography */
h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', sans-serif;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-base);
}

.blob-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vw;
  height: 150vw;
  transform: translate(-50%, -50%);
  filter: blur(80px);
  opacity: 0.6;
}

.blob {
  transform-origin: center;
}

.blob-1 { animation: rotate 20s linear infinite; }
.blob-2 { animation: rotate 25s reverse infinite; }
.blob-3 { animation: blob-bounce 15s ease-in-out infinite alternate; }

.glass-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  min-height: 100vh;
  gap: 32px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-shadow);
  z-index: 10;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-spotify), var(--accent-3));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(30, 215, 96, 0.4);
  animation: pulse-glow 3s infinite;
}

.app-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #a0a0b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status Indicator */
.status-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444;
}

.status-dot.connected {
  background: var(--accent-spotify);
  box-shadow: 0 0 10px var(--accent-spotify);
  animation: pulse-dot 2s infinite;
}

/* Main Content Area */
.main-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  flex: 1;
}

/* Sidebar Navigation */
.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-item {
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateX(8px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.15), rgba(121, 40, 202, 0.15));
  border: 1px solid rgba(255, 0, 128, 0.3);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(255, 0, 128, 0.1);
}

.nav-icon {
  font-size: 20px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-content: start;
}

.grid-full {
  grid-column: 1 / -1;
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.glass-card:hover::before {
  transform: translateX(100%);
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-bounce);
}

.stat-box:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.05);
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255, 0, 128, 0.2));
}

.stat-value.spotify {
  background: linear-gradient(135deg, #1ed760, #4facfe);
  -webkit-background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(30, 215, 96, 0.2));
}

.stat-value.yandex {
  background: linear-gradient(135deg, #ffcc00, #ff0080);
  -webkit-background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(255, 204, 0, 0.2));
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* Info Rows (Status Card) */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

/* Badges */
.badge {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-idle { background: rgba(79, 172, 254, 0.15); color: #4facfe; border: 1px solid rgba(79, 172, 254, 0.3); }
.badge-syncing { background: rgba(30, 215, 96, 0.15); color: #1ed760; border: 1px solid rgba(30, 215, 96, 0.3); }
.badge-error { background: rgba(255, 68, 68, 0.15); color: #ff4444; border: 1px solid rgba(255, 68, 68, 0.3); }
.badge-paused { background: rgba(255, 204, 0, 0.15); color: #ffcc00; border: 1px solid rgba(255, 204, 0, 0.3); }

.syncing-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

/* Buttons */
.controls-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-super {
  position: relative;
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-super::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  opacity: 0.8;
  transition: opacity 0.3s;
  z-index: 1;
}

.btn-super:hover::before {
  opacity: 1;
}

.btn-super.sync-btn::before {
  background: linear-gradient(135deg, var(--accent-spotify), #059669);
}

.btn-super.pause-btn::before {
  background: linear-gradient(135deg, var(--accent-yandex), #ea580c);
}

.btn-super.resume-btn::before {
  background: linear-gradient(135deg, var(--accent-3), #0284c7);
}

.btn-super span {
  position: relative;
  z-index: 2;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-super:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0,0,0,0.3);
}

.btn-super:active {
  transform: translateY(2px) scale(0.98);
}

.btn-super:disabled {
  filter: grayscale(1) opacity(0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Tables Customization for new style */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

th {
  text-align: left;
  padding: 16px;
  color: var(--text-secondary);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

tr {
  transition: transform 0.2s;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
  transform: scale(1.01);
}

/* Search Input */
.search-input {
  width: 100%;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  transition: var(--transition-fast);
  margin-bottom: 24px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-3);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .nav-sidebar {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .nav-item {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    gap: 16px;
    border-radius: var(--radius-lg);
  }
  .app-container {
    padding: 16px;
  }
}
