/* ============================================================
   🔥 GPT Rate Limit Burner - Styles
   Dark Mode + Fire Theme + Glassmorphism
   ============================================================ */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(255, 100, 50, 0.15);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;

  /* Fire Gradient */
  --fire-1: #ff4500;
  --fire-2: #ff6b35;
  --fire-3: #ffa500;
  --fire-4: #ffd700;
  --gradient-fire: linear-gradient(135deg, var(--fire-1), var(--fire-2), var(--fire-3));
  --gradient-fire-soft: linear-gradient(135deg, rgba(255,69,0,0.15), rgba(255,165,0,0.08));

  /* Status Colors */
  --color-success: #00e676;
  --color-warning: #ffab00;
  --color-error: #ff1744;
  --color-info: #448aff;

  /* Shadows */
  --shadow-fire: 0 0 30px rgba(255, 69, 0, 0.15), 0 0 60px rgba(255, 69, 0, 0.05);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  line-height: 1.6;
}

/* ============================================================
   Particle Canvas Background
   ============================================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   App Container
   ============================================================ */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ============================================================
   Glass Card
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 2rem;
  animation: fireGlow 2s ease-in-out infinite alternate;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
  transition: background 0.3s ease;
}

.status-dot.connected {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================
   Status Card
   ============================================================ */
.status-card {
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
}

.status-display {
  margin-bottom: 32px;
}

.status-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: inline-block;
}

.status-icon.running {
  animation: fireGlow 1s ease-in-out infinite alternate, bounce 0.6s ease-in-out infinite;
}

.status-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: scale(0.97);
}

.btn-icon {
  font-size: 1.2rem;
}

.btn-launch {
  background: linear-gradient(135deg, #448aff, #2962ff);
  color: white;
  box-shadow: 0 4px 15px rgba(68, 138, 255, 0.3);
}

.btn-launch:hover {
  box-shadow: 0 6px 25px rgba(68, 138, 255, 0.4);
  transform: translateY(-2px);
}

.btn-start {
  background: var(--gradient-fire);
  color: white;
  box-shadow: var(--shadow-glow);
  font-size: 1.2rem;
  padding: 16px 48px;
  animation: fireButtonPulse 2s ease-in-out infinite;
}

.btn-start:hover {
  box-shadow: 0 0 35px rgba(255, 107, 53, 0.5);
  transform: translateY(-3px) scale(1.02);
}

.btn-pause {
  background: linear-gradient(135deg, #ffab00, #ff8f00);
  color: #1a1a2e;
}

.btn-resume {
  background: linear-gradient(135deg, #00e676, #00c853);
  color: #1a1a2e;
}

.btn-stop {
  background: linear-gradient(135deg, #ff1744, #d50000);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 23, 68, 0.3);
}

.btn-stop:hover {
  box-shadow: 0 6px 25px rgba(255, 23, 68, 0.4);
}

/* ============================================================
   Settings Card
   ============================================================ */
.settings-card {
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.setting-select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238888a0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 32px;
}

.setting-select:focus {
  outline: none;
  border-color: var(--fire-2);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-secondary);
  outline: none;
  cursor: pointer;
}

.setting-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-fire);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.4);
  transition: transform 0.2s ease;
}

.setting-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.setting-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-fire);
  cursor: pointer;
  border: none;
}

.setting-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fire-3);
  min-width: 28px;
  text-align: center;
}

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

/* ============================================================
   Stats Grid
   ============================================================ */
.stats-section {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-fire);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.stat-value.counting {
  color: var(--fire-3);
  text-shadow: 0 0 30px rgba(255, 165, 0, 0.4);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   Chart Section
   ============================================================ */
.chart-section {
  padding: 24px;
  margin-bottom: 20px;
}

.chart-container {
  height: 200px;
  position: relative;
}

/* ============================================================
   Message Section
   ============================================================ */
.message-section {
  padding: 24px;
  margin-bottom: 20px;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-sent, .message-received {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
}

.message-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.message-sent p, .message-received p {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}

/* ============================================================
   Log Section
   ============================================================ */
.log-section {
  padding: 24px;
  margin-bottom: 20px;
}

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

.log-header .section-title {
  margin-bottom: 0;
}

.btn-clear-log {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-clear-log:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.log-container {
  max-height: 350px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.log-container::-webkit-scrollbar {
  width: 4px;
}

.log-container::-webkit-scrollbar-track {
  background: transparent;
}

.log-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.log-entry {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  animation: slideIn 0.3s ease;
  align-items: flex-start;
}

.log-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 65px;
}

.log-message {
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.log-info { background: rgba(68, 138, 255, 0.05); border-right: 3px solid var(--color-info); }
.log-success { background: rgba(0, 230, 118, 0.05); border-right: 3px solid var(--color-success); }
.log-warning { background: rgba(255, 171, 0, 0.05); border-right: 3px solid var(--color-warning); }
.log-error { background: rgba(255, 23, 68, 0.05); border-right: 3px solid var(--color-error); }

/* ============================================================
   Rate Limit Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.5s ease;
}

.modal {
  padding: 48px;
  text-align: center;
  max-width: 450px;
  width: 90%;
  animation: modalBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: celebrationBounce 0.8s ease-in-out infinite alternate;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-stats {
  margin-bottom: 24px;
  text-align: right;
}

.modal-stats p {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-stats span {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fire-3);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fireGlow {
  from { filter: brightness(1) drop-shadow(0 0 4px rgba(255, 69, 0, 0.3)); }
  to { filter: brightness(1.3) drop-shadow(0 0 12px rgba(255, 165, 0, 0.6)); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fireButtonPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 107, 53, 0.3); }
  50% { box-shadow: 0 0 40px rgba(255, 107, 53, 0.5), 0 0 60px rgba(255, 69, 0, 0.2); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalBounce {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes celebrationBounce {
  from { transform: scale(1) rotate(-5deg); }
  to { transform: scale(1.15) rotate(5deg); }
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .logo h1 {
    font-size: 1.2rem;
  }

  .status-card {
    padding: 28px 20px;
  }

  .btn-start {
    font-size: 1rem;
    padding: 14px 36px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-content {
    flex-direction: column;
    gap: 12px;
  }
}

/* ============================================================
   Unified MCP Server Custom Styles
   ============================================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(255, 23, 68, 0.1);
  border-color: var(--color-error);
  color: var(--text-primary);
}

.integration-guide {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-right: 20px;
}

.integration-guide li {
  margin-bottom: 16px;
  line-height: 1.7;
}

.code-block-container {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  width: 100%;
}

.code-url {
  font-family: var(--font-mono);
  color: var(--fire-3);
  font-size: 0.9rem;
  word-break: break-all;
  direction: ltr;
  text-align: left;
}

