@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-app: #06070b;
  --bg-panel: rgba(16, 20, 35, 0.6);
  --bg-input: rgba(30, 41, 59, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(34, 211, 238, 0.25);
  
  --primary: #22d3ee;
  --primary-hover: #06b6d4;
  --primary-glow: rgba(34, 211, 238, 0.4);
  
  --secondary: #8b5cf6;
  --success: #10b981;
  --error: #f43f5e;
  --warning: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(34, 211, 238, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dark);
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition);
}

/* AUTH VIEWS (LOGIN / SIGNUP / FORGOT) */
.auth-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.auth-card {
  padding: 40px 30px;
  width: 100%;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  font-size: 40px;
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
  margin-bottom: 10px;
}

.auth-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 5px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input-ctrl {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}

.input-ctrl:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--border-glow);
  background: rgba(30, 41, 59, 0.6);
}

.input-ctrl.invalid, .select-site-ctrl.invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25) !important;
}

.btn-ctrl {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #020617;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-ctrl:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-ctrl:active {
  transform: translateY(0);
}

.auth-links {
  margin-top: 25px;
  text-align: center;
  font-size: 14px;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.auth-links a:hover {
  color: var(--text-main);
  text-shadow: 0 0 8px var(--primary-glow);
}

.divider {
  color: var(--text-dark);
  margin: 0 10px;
}

/* MAIN DASHBOARD LAYOUT */
.dashboard-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 11, 16, 0.8);
}

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

.header-brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-brand h1 span {
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary-glow);
}

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

/* Dropdown Site Selector */
.select-site-ctrl {
  padding: 10px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-site-ctrl:focus {
  border-color: var(--primary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.user-tag {
  color: var(--text-muted);
  font-size: 14px;
}

.user-tag strong {
  color: var(--text-main);
}

/* Grid Layout Dashboard Columns */
.dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 340px 1fr 340px;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
}

@media(max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.grid-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 20px;
}

@media(max-width: 1200px) {
  .grid-panel {
    height: auto;
    max-height: 500px;
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
}

/* CONFIGURATION COLUMN (Left Panel) */
.config-form .form-group {
  margin-bottom: 15px;
}

.config-form label {
  font-size: 12px;
}

.config-form .input-ctrl {
  padding: 10px 12px;
  font-size: 14px;
}

.feed-url-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-icon-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--error);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-danger:hover {
  background: var(--error);
  color: white;
}

/* CONSOLE/LOGS COLUMN (Middle Panel) */
.console-panel {
  background: #020306;
  border: 1px solid #141724;
}

.console-terminal {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  background: #020204;
  color: #a7f3d0;
  padding: 15px;
  border-radius: 8px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.log-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line.error { color: #f43f5e; }
.log-line.warning { color: #f59e0b; }
.log-line.success { color: #10b981; }

.console-header-stats {
  display: flex;
  gap: 15px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
}

.stat-item {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-item span {
  color: var(--primary);
  font-weight: 600;
}

/* HISTORY COLUMN (Right Panel) */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: var(--transition);
}

.history-item:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.04);
}

.history-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item-time {
  font-size: 11px;
  color: var(--text-dark);
}

.history-item-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-item-link:hover {
  text-decoration: underline;
}

/* Notification banner */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 25px;
  background: #1e293b;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
}

#toast.show {
  transform: translateY(0);
}

#toast.error {
  border-left-color: var(--error);
}

#toast.success {
  border-left-color: var(--success);
}

/* Modals views configuration */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 30px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}

/* Utility visibility classes */
.hidden {
  display: none !important;
}

.spinner {
  border: 3px solid rgba(255,255,255,0.1);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border-left-color: var(--text-main);
  animation: spin 1s linear infinite;
}

.spinner-small {
  border: 2px solid rgba(255,255,255,0.1);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border-left-color: currentColor;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
