/* ═══════════════════════════════════════════
   Amazon Fiyat Takip Botu — Modern Dark Theme
   ═══════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #1f2a3f;
  --bg-input: #0f1623;
  --bg-sidebar: #0d1321;

  --text-primary: #e8ecf4;
  --text-secondary: #8b97b0;
  --text-muted: #5a6478;

  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.3);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.3);
  --accent-orange: #f59e0b;
  --accent-orange-glow: rgba(245, 158, 11, 0.3);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.3);
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;

  --border-color: rgba(255, 255, 255, 0.06);
  --border-focus: var(--accent-blue);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px var(--accent-blue-glow);
  --shadow-glow-green: 0 0 20px var(--accent-green-glow);

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 60px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  color: #60a5fa;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0e17 0%, #111827 50%, #0d1b2a 100%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  z-index: 2;
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-glow-blue);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.auth-brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #e8ecf4, #8b97b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.auth-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  display: none;
}

.auth-form.active {
  display: block;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Animated bg shapes */
.auth-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: drift 20s ease-in-out infinite;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-blue);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-purple);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-cyan);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(20px, 10px) scale(1.02);
  }
}

/* ═══════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.form-group label i {
  margin-right: 0.3rem;
  opacity: 0.7;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
.select-styled {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

input:focus,
textarea:focus,
.select-styled:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

textarea {
  resize: vertical;
}

.select-styled {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b97b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-row .flex-2 {
  flex: 2;
}

.form-row .flex-1 {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Toggle Switch */
.toggle-label {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  position: relative;
  transition: var(--transition-normal);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: var(--transition-normal);
}

.toggle-label input:checked+.toggle-switch {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.toggle-label input:checked+.toggle-switch::after {
  transform: translateX(20px);
  background: white;
}

/* ═══════════════════════════════════
   BUTTONS
   ═══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn i {
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  box-shadow: 0 2px 8px var(--accent-blue-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-blue-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost.active {
  color: var(--accent-blue);
  background: var(--accent-blue-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════ */
.main-panel {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-normal);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon-sm {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-toggle-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  color: var(--accent-blue);
  box-shadow: inset 3px 0 0 var(--accent-blue);
}

.nav-item i {
  width: 22px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.user-info i {
  font-size: 1.2rem;
}

/* ── MOBILE HEADER ── */
.mobile-header {
  display: none;
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
}

.mobile-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* ── CONTENT ── */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 1.5rem 2rem;
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-header h1 i {
  color: var(--accent-blue);
  font-size: 1.2rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ═══════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-blue .stat-icon {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.stat-green .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.stat-orange .stat-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.stat-purple .stat-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.stat-blue:hover {
  box-shadow: var(--shadow-glow-blue);
}

.stat-green:hover {
  box-shadow: var(--shadow-glow-green);
}

.stat-orange:hover {
  box-shadow: 0 0 20px var(--accent-orange-glow);
}

.stat-purple:hover {
  box-shadow: 0 0 20px var(--accent-purple-glow);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════
   CARDS
   ═══════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h3 i {
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.card-body {
  padding: 1.25rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
}

/* ═══════════════════════════════════
   NOTIFICATIONS LIST
   ═══════════════════════════════════ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notif-icon.drop {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.notif-icon.target {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.notif-icon.stock {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.notif-info {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ═══════════════════════════════════
   PRODUCTS
   ═══════════════════════════════════ */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-box input {
  padding-left: 2.5rem;
}

.filters-bar .select-styled {
  width: auto;
  min-width: 160px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-card-img {
  height: 160px;
  overflow: hidden;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-card-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  padding: 0.75rem;
}

.product-card-img .status-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.badge-paused {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-orange);
}

.badge-out_of_stock {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.product-card-body {
  padding: 1rem;
}

.product-card-title,
.product-card-title-link {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
  min-height: 2.4em;
}

.product-card-title-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.product-card-title-link:hover {
  color: var(--accent-blue);
}

a.product-card-img {
  display: flex;
  cursor: pointer;
}

a.product-card-img:hover {
  opacity: 0.85;
}

.product-prices {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.price-current {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-green);
}

.price-target {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.product-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.product-card-actions {
  display: flex;
  gap: 0.4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.product-card-actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.78rem;
}

/* ── ÜRÜN KONTROL ANİMASYONU ── */
.product-card {
  position: relative;
}

.product-card.checking {
  pointer-events: none;
  animation: cardPulse 1.5s ease-in-out infinite;
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow-blue);
}

.product-card.checking .product-card-body,
.product-card.checking .product-card-img {
  opacity: 0.45;
  filter: saturate(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

@keyframes cardPulse {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
  }

  50% {
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
    border-color: rgba(59, 130, 246, 0.7);
  }
}

.product-check-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(4px);
  z-index: 10;
  border-radius: var(--radius-md);
  animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.product-check-overlay span {
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.check-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Başarılı kontrol — yeşil flash */
.product-card.check-success {
  animation: successFlash 1.2s ease;
  border-color: var(--accent-green);
}

@keyframes successFlash {
  0% {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
    border-color: var(--accent-green);
  }

  100% {
    box-shadow: none;
    border-color: var(--border-color);
  }
}

/* Başarısız kontrol — kırmızı flash */
.product-card.check-error {
  animation: errorFlash 1.2s ease;
  border-color: var(--accent-red);
}

@keyframes errorFlash {
  0% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
    border-color: var(--accent-red);
  }

  100% {
    box-shadow: none;
    border-color: var(--border-color);
  }
}

/* ═══════════════════════════════════
   PROXIES TABLE
   ═══════════════════════════════════ */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.data-table thead {
  position: sticky;
  top: 0;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.proxy-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.proxy-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.proxy-status.inactive {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.proxy-status.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.proxy-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.load-bar {
  width: 80px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.load-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-normal);
}

/* ═══════════════════════════════════
   SETTINGS
   ═══════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
}

/* ═══════════════════════════════════
   MODALS
   ═══════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s ease;
}

.modal-lg {
  max-width: 700px;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h3 i {
  color: var(--accent-blue);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Chart */
.chart-container {
  height: 300px;
  position: relative;
}

.history-period-selector {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  animation: toastSlideIn 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast.success::before {
  background: var(--accent-green);
}

.toast.error::before {
  background: var(--accent-red);
}

.toast.info::before {
  background: var(--accent-blue);
}

.toast.warning::before {
  background: var(--accent-orange);
}

.toast i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast.success i {
  color: var(--accent-green);
}

.toast.error i {
  color: var(--accent-red);
}

.toast.info i {
  color: var(--accent-blue);
}

.toast.warning i {
  color: var(--accent-orange);
}

.toast-msg {
  font-size: 0.85rem;
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ═══════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 0;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .mobile-header {
    display: flex;
  }

  .content {
    margin-left: 0;
    padding: 1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filters-bar .select-styled {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    margin: 0.5rem;
  }

  #toast-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-container {
    padding: 1rem;
  }

  .auth-form {
    padding: 1.5rem;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  display: none;
}

.sidebar-overlay.active {
  display: block;
}