:root {
  --font-heading: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Color Palette - Vibrant Dark Mode */
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(23, 33, 53, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(16, 185, 129, 0.4);
  
  --primary: #10B981; /* Emerald green (WhatsApp feel but modern) */
  --primary-glow: rgba(16, 185, 129, 0.15);
  --primary-hover: #059669;
  
  --secondary: #6366F1; /* Indigo */
  --secondary-hover: #4F46E5;
  
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --warning: #F59E0B;
  
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --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-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 1rem;
}

/* Ambient glow backgrounds */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.glow-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -50px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  left: -100px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-content h1 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 0%, #A7F3D0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-content .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-content .icon {
  font-size: 2rem;
}

.app-header .subtitle {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* Connection Status Pulse */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-indicator.connected {
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--primary);
}

.status-indicator.disconnected {
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.6s infinite;
}

.status-indicator.disconnected .pulse {
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 450px 1fr;
  }
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  margin-bottom: 1.75rem;
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.queue-stats .badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-6 {
  flex: 1;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="time"],
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

select option {
  background-color: #0B0F19; /* same as var(--bg-main) */
  color: var(--text-primary);
}

textarea {
  resize: vertical;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Toggle Option Radios */
.toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
}

.toggle-option {
  flex: 1;
  cursor: pointer;
  margin-bottom: 0;
  text-align: center;
}

.toggle-option input[type="radio"] {
  display: none;
}

.toggle-option span {
  display: block;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: var(--transition);
}

.toggle-option input[type="radio"]:checked + span {
  background: var(--primary);
  color: #000000;
  box-shadow: var(--shadow-sm);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.01);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.02);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.dropzone-content .primary-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.dropzone-content .primary-text span {
  color: var(--primary);
  text-decoration: underline;
}

.dropzone-content .secondary-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Image Preview inside Dropzone */
.image-preview-container {
  position: relative;
  width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #FFF;
  font-size: 1.5rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
}

.btn-remove-preview:hover {
  background: var(--danger);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #0B0F19;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

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

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.form-actions .btn {
  flex: 1;
}

/* Job Queue / Cards List */
.queue-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-height: 750px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Job Card Details */
.job-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  position: relative;
  transition: var(--transition);
  animation: slideIn 0.3s ease-out;
}

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

.job-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}

.job-card.paused {
  opacity: 0.65;
}

.job-thumbnail {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #000;
}

.job-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-no-image {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.job-no-image span {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.job-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.job-caption-preview {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}

.job-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-value {
  font-weight: 600;
}

.meta-value.highlight {
  color: var(--secondary);
}

/* Card Control Panel Overlay */
.job-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  margin-left: auto;
}

.action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

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

.action-btn.edit-btn:hover {
  color: var(--secondary);
  border-color: rgba(99, 102, 241, 0.3);
}

.action-btn.delete-btn:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.action-btn.send-btn:hover {
  color: var(--primary);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
}

.status-badge.paused {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-badge.completed {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* Helpers */
.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .col-6 {
    width: 100%;
  }
  .job-card {
    flex-direction: column;
  }
  .job-thumbnail {
    width: 100%;
    height: 140px;
  }
  .job-actions {
    align-self: flex-end;
    margin-top: 1rem;
  }
}

/* Login Page Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.login-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

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

.login-card h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #FFFFFF 0%, #A7F3D0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.btn-block {
  width: 100%;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1rem;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

