/* Global Theme Reset & Base */
:root {
  --bg-primary: #0b0c16;
  --bg-secondary: rgba(22, 24, 47, 0.6);
  --bg-glass: rgba(25, 27, 54, 0.45);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(168, 85, 247, 0.6);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --primary: #a855f7;
  --primary-hover: #c084fc;
  --primary-glow: rgba(168, 85, 247, 0.4);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.4);
  
  --accent: #06b6d4;
  
  --follow-color: #ec4899;
  --sub-color: #eab308;
  --cheer-color: #06b6d4;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Blurry Background Shapes */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
  filter: blur(80px);
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 2rem;
}

/* Header Styles */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, var(--primary-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.status-bar {
  display: flex;
  gap: 1.5rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  font-size: 0.9rem;
  font-weight: 500;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: pulse 2s infinite;
}

.status-dot.green {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.red {
  background-color: var(--error);
  box-shadow: 0 0 8px var(--error);
}

.status-dot.orange {
  background-color: var(--sub-color);
  box-shadow: 0 0 8px var(--sub-color);
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

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

/* Card Styling */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(168, 85, 247, 0.05);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.card-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Config Card Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-group input, 
.test-input, 
.test-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-group input:focus, 
.test-input:focus, 
.test-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  background: rgba(0, 0, 0, 0.4);
}

.password-input-wrapper {
  position: relative;
  display: flex;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 3rem;
}

.icon-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-main);
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Button Styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  border: none;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #0891b2);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.6);
  transform: translateY(-1px);
}

/* Setup Instructions */
.setup-instructions {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.setup-instructions h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary-hover);
}

.setup-instructions ol {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  line-height: 1.5;
}

.setup-instructions a {
  color: var(--accent);
  text-decoration: underline;
}

.selectable-code {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary-hover);
  word-break: break-all;
  display: inline-block;
  margin-top: 0.25rem;
}

.btn-mini-copy {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.2s;
}

.btn-mini-copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Test Buttons Cards */
.test-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.test-action-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 640px) {
  .test-action-box {
    flex-direction: column;
    align-items: stretch;
  }
}

.test-action-box .btn {
  flex-shrink: 0;
  min-width: 180px;
}

.test-input-row {
  display: flex;
  gap: 0.5rem;
  flex-grow: 1;
}

.test-input {
  flex-grow: 1;
}

.test-select {
  width: 100px;
}

.bits-input {
  width: 90px;
}

.btn-alert-follow {
  background: linear-gradient(135deg, var(--follow-color), #db2777);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-alert-follow:hover {
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.5);
  transform: translateY(-1px);
}

.btn-alert-sub {
  background: linear-gradient(135deg, var(--sub-color), #ca8a04);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.btn-alert-sub:hover {
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.5);
  transform: translateY(-1px);
}

.btn-alert-cheer {
  background: linear-gradient(135deg, var(--cheer-color), #0891b2);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn-alert-cheer:hover {
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* OBS Copy Link styles */
.copy-link-container {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.overlay-url {
  flex-grow: 1;
  padding: 0.85rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  word-break: break-all;
}

.btn-copy {
  border-radius: 0 12px 12px 0;
  flex-shrink: 0;
}

.obs-settings-tips {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 14px;
  padding: 1.25rem;
}

.obs-settings-tips h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.obs-settings-tips ul {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Log Container */
.logs-card {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .logs-card {
    grid-column: span 1;
  }
}

.btn-mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s;
}

.btn-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.log-container {
  padding: 0;
}

.terminal-body {
  background: #05060b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #10b981;
  padding: 1.5rem;
  height: 250px;
  overflow-y: auto;
  border-radius: 0 0 20px 20px;
  line-height: 1.6;
}

.log-line {
  margin-bottom: 0.4rem;
  word-break: break-all;
}

.log-line.system {
  color: #9ca3af;
}

.log-line.error {
  color: var(--error);
}

.log-line.success {
  color: var(--success);
}

.log-line.event {
  color: #f472b6;
}

/* Custom Scrollbar for Terminal */
.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Footer Styling */
.main-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-glass);
}

/* TTS Configuration Card Styles */
.form-group-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.switch-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.label-val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

.label-val-row span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

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

.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);
  border: 1px solid var(--border-glass);
  transition: .3s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-main);
  transition: .3s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round::before {
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary-hover);
  box-shadow: 0 0 10px var(--primary-glow);
}

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

/* Range Slider Styling */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  outline: none;
  transition: background 0.2s;
  padding: 0;
  border: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-glow);
  transition: transform 0.1s ease;
}

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

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--primary-glow);
  transition: transform 0.1s ease;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: var(--primary-hover);
}

/* Raid Test Button Styles */
.btn-alert-raid:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5) !important;
}
