/* ========================================
   Modern Dark Theme - Mshari's Movies Manager
   ======================================== */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Inline input row with unit chip */
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-row .form-input {
  height: 36px;
}

.flex-1 { flex: 1 1 auto; }

.unit-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: #1f2937;
  border: 1px solid #374151;
  color: #9ca3af;
  font-size: 12px;
  min-width: 40px;
}

/* Form row: two columns sections with consistent spacing */
.form-row {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0a0e1a;
  color: #e5e7eb;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.container-sm {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
}

h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

p {
  margin: 0;
}

.text-muted {
  color: #9ca3af;
}

.text-sm {
  font-size: 14px;
}

.text-xs {
  font-size: 12px;
}

/* === HEADER === */
.site-header {
  background: #0f1419;
  border-bottom: 1px solid #1f2937;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.brand svg {
  width: 24px;
  height: 24px;
  color: #6366f1;
}

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

.user-badge {
  display: none;
  align-items: center;
  gap: 8px;
  background: #1a1f2e;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  color: #d1d5db;
}

@media (min-width: 640px) {
  .user-badge {
    display: flex;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.btn-primary {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #7c3aed;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-amber {
  background: #f59e0b;
  color: #ffffff;
}

.btn-amber:hover:not(:disabled) {
  background: #d97706;
}

.btn-emerald {
  background: #10b981;
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background: #059669;
}

.btn-ghost {
  background: #1f2937;
  color: #d1d5db;
  border: 1px solid #374151;
}

.btn-ghost:hover:not(:disabled) {
  background: #374151;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* === CARDS === */
.card {
  background: #0f1419;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  border-color: #374151;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.card-title svg {
  width: 24px;
  height: 24px;
}

.card-desc {
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 16px;
}

/* === GRID === */
.grid {
  display: grid;
  gap: 24px;
}

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

@media (min-width: 768px) {
  .grid-cols-md-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-cols-lg-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === ALERTS === */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

/* === FORMS === */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #d1d5db;
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: #0f1419;
  color: #ffffff;
  border: 1px solid #2d3748;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Input error state */
.input-error {
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

/* Input with suffix (e.g., MB, GB) */
.input-with-suffix {
  position: relative;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 12px;
  pointer-events: none;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Form check wrapper */
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: #1f2937;
  color: #9ca3af;
  border: 1px solid #374151;
  border-radius: 999px;
}

/* === AUTH PAGE === */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
}

.auth-glow-blob {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
}

.auth-glow-blob-1 {
  background: rgba(99, 102, 241, 0.5);
  top: -200px;
  left: -200px;
}

.auth-glow-blob-2 {
  background: rgba(168, 85, 247, 0.5);
  bottom: -200px;
  right: -200px;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

.auth-logo svg {
  width: 48px;
  height: 48px;
  color: #a5b4fc;
}

.auth-title {
  margin-top: 20px;
  font-size: 36px;
  font-weight: 800;
}

.auth-subtitle {
  margin-top: 8px;
  color: #9ca3af;
  font-size: 16px;
}

.auth-card {
  margin-top: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.auth-footer {
  margin-top: 24px;
  font-size: 13px;
  color: #6b7280;
}

/* Floating label input */
.form-floating {
  position: relative;
}

.form-floating .form-input {
  padding-top: 20px;
  padding-bottom: 8px;
}

.form-floating .form-label {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 12px;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.2s ease;
}

/* === CONVERTER PAGE === */
.converter-page {
  min-height: 100vh;
  padding: 24px 0;
}

.converter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.converter-title {
  font-size: 32px;
  margin-bottom: 8px;
}

.converter-subtitle {
  color: #9ca3af;
  font-size: 16px;
}

/* Upload dropzone */
.dropzone {
  display: block;
  width: 100%;
  padding: 60px 24px;
  text-align: center;
  border: 2px dashed #374151;
  border-radius: 16px;
  background: rgba(15, 20, 25, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dropzone:hover {
  border-color: #4b5563;
  background: rgba(15, 20, 25, 0.8);
}

.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 50%;
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
  color: #9ca3af;
}

.dropzone-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.dropzone-subtitle {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.dropzone-note {
  font-size: 12px;
  color: #6b7280;
}

/* Settings view */
.settings-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr 2fr;
  }
}

.file-info-card {
  padding: 20px;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.file-meta svg {
  width: 24px;
  height: 24px;
  color: #6366f1;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.file-size {
  font-size: 12px;
  color: #9ca3af;
}

/* Progress bar */
.progress-container {
  text-align: center;
  padding: 32px;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #1f2937;
  border-radius: 999px;
  overflow: hidden;
  margin: 24px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-status {
  font-size: 14px;
  color: #93c5fd;
  margin-bottom: 8px;
}

.progress-filename {
  font-size: 14px;
  color: #d1d5db;
}

/* Complete view */
.complete-container {
  text-align: center;
  padding: 48px 24px;
}

.complete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 50%;
}

.complete-icon svg {
  width: 32px;
  height: 32px;
  color: #10b981;
}

.complete-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.complete-filename {
  font-size: 16px;
  color: #9ca3af;
  margin-bottom: 24px;
}

.complete-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.text-error { color: #fca5a5; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

/* Sticky form actions at card bottom */
.form-sticky-actions {
  position: sticky;
  bottom: -24px; /* aligns with card padding */
  padding-top: 12px;
  margin-top: 24px;
  background: linear-gradient(to bottom, rgba(15,20,25,0), #0f1419 40%);
  border-top: 1px solid #1f2937;
}

/* Disabled button class toggle support */
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
