/* Kling Motion Control Admin Portal CSS */
:root {
  --font-sans: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --bg-base:     #0a0a0f;
  --bg-surface:  rgba(20, 20, 30, 0.6);
  --bg-elevated: rgba(30, 30, 45, 0.8);
  --bg-hover:    rgba(50, 50, 75, 0.9);
  
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  
  --text-primary:   #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;
  
  --accent:        #6366f1; /* Indigo */
  --accent-hover:  #4f46e5;
  --accent-subtle: rgba(99, 102, 241, 0.15);
  --premium:       #818cf8;
  
  --success:       #10b981;
  --pending:       #f59e0b;
  --info:          #3b82f6;
  --danger:        #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 10% 20%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(244, 63, 94, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
}

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

header {
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.5);
  backdrop-filter: blur(8px);
}

header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Auth Page layout */
.auth-container {
  max-width: 420px;
  margin: 120px auto;
  padding: 32px;
  width: 100%;
}

.auth-container h2 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 700;
  text-align: center;
}

.auth-container p {
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Dashboard layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  padding: 24px 32px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex-grow: 1;
}

.dashboard-panel {
  padding: 24px;
  height: fit-content;
}

.dashboard-panel h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* File slot preview styling */
.file-slot-container {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.file-slot-container:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.03);
}

.file-slot-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.preview-item {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* Jobs Table / List */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.job-card {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.job-card:hover {
  background: var(--bg-hover);
}

.job-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.job-thumbnails {
  display: flex;
  gap: 8px;
}

.job-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.job-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-title {
  font-size: 14px;
  font-weight: 600;
}

.job-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.badge {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-running { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-completed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.job-actions {
  display: flex;
  gap: 8px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Modal backdrop and card styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-card {
  width: 90%;
  max-width: 480px;
  padding: 24px;
  animation: modalSlideIn 0.2s ease-out;
}

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

/* Gallery and Tabs Styles */
.active-tab-btn {
  background: var(--accent) !important;
  color: white !important;
  border-color: transparent !important;
}

.gallery-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.gallery-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
}

.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-select-wrapper {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-select-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.gallery-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.gallery-prompt {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-date {
  font-size: 10px;
  color: var(--text-muted);
}

.gallery-actions {
  display: flex;
  border-top: 1px solid var(--border);
}

.gallery-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.gallery-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gallery-btn.download-btn {
  color: var(--success);
}

.gallery-btn.delete-btn {
  color: var(--danger);
  border-left: 1px solid var(--border);
}
