/* ==========================================================================
   AeroDeals - Admin Dashboard Stylesheet
   ========================================================================== */

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

:root {
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;

  --admin-bg: #0b0f19;
  --admin-surface: #111827;
  --admin-card: #1f2937;
  --admin-card-hover: #283548;
  --admin-border: rgba(255, 255, 255, 0.08);
  --admin-border-hover: rgba(56, 189, 248, 0.35);

  --accent-sky: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--admin-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* ==================== Auth Gate / Login Screen ==================== */
.login-screen-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(2, 132, 199, 0.15) 0%, transparent 55%),
              linear-gradient(180deg, #090d16 0%, #0b0f19 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--admin-border);
  border-radius: 24px;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(2, 132, 199, 0.15);
  text-align: center;
}

.login-header-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: rgba(31, 41, 55, 0.95);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.6);
}

.login-hint {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(2, 132, 199, 0.1);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-align: left;
}

/* ==================== Admin Dashboard Layout ==================== */
.admin-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  padding: 0.65rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.admin-tag {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Language Selector */
.lang-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border);
  border-radius: 9999px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

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

.lang-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.btn-nav-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
}

.btn-danger-outline {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
}

/* ==================== Main Admin Content ==================== */
.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.75rem 4rem;
  width: 100%;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-icon.total { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.stat-icon.active { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.stat-icon.disabled { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.stat-icon.storage { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.stat-number {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Controls & Toolbar */
.toolbar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 300px;
  max-width: 500px;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==================== Offers Table & List ==================== */
.table-container {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.offers-table th {
  background: rgba(31, 41, 55, 0.6);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--admin-border);
}

.offers-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.offers-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-media-thumb {
  width: 75px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: #1f2937;
}

.table-offer-headline {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.table-offer-route {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.table-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-cyan);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  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: #374151;
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-emerald);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.status-badge.enable {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.disable {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
}

.btn-icon.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* ==================== Modal Dialogs ==================== */
.admin-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.admin-modal {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 20px;
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.admin-modal-overlay.active .admin-modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.upload-dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.upload-preview-wrap {
  position: relative;
  width: 100%;
  max-height: 220px;
  overflow: hidden;
  border-radius: 12px;
  margin-top: 1rem;
}

.upload-preview-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
}

.modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  background: rgba(31, 41, 55, 0.3);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--admin-border);
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
  animation: toastIn 0.3s ease forwards;
}

.toast.success { border-color: var(--accent-emerald); color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); color: var(--accent-rose); }
.toast.info { border-color: var(--accent-cyan); color: var(--accent-cyan); }

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

@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
  .offers-table {
    display: block;
    overflow-x: auto;
  }
}

/* ==================== WYSIWYG HTML Editor ==================== */
.wysiwyg-tab-bar {
  display: flex;
  gap: 0.5rem;
}

.wysiwyg-tab-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 9px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--admin-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wysiwyg-tab-btn:hover {
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

.wysiwyg-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.wysiwyg-container {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wysiwyg-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: rgba(31, 41, 55, 0.9);
  border-bottom: 1px solid var(--admin-border);
}

.wysiwyg-select {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--text-main);
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.wysiwyg-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.wysiwyg-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.wysiwyg-btn:active {
  transform: scale(0.95);
}

.wysiwyg-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 0.25rem;
}

.wysiwyg-badge-hint {
  font-size: 0.74rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.wysiwyg-editor {
  min-height: 240px;
  max-height: 480px;
  overflow-y: auto;
  padding: 1.25rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  outline: none;
}

.wysiwyg-editor[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
}

.wysiwyg-editor.dragover {
  background: rgba(56, 189, 248, 0.08);
  outline: 2px dashed var(--accent-cyan);
}

/* Embedded Content Inside Editor */
.wysiwyg-editor h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin: 1.25rem 0 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.3rem;
}

.wysiwyg-editor h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 1rem 0 0.5rem 0;
}

.wysiwyg-editor p {
  margin-bottom: 0.85rem;
}

.wysiwyg-editor ul,
.wysiwyg-editor ol {
  margin: 0.75rem 0 1rem 1.5rem;
}

.wysiwyg-editor li {
  margin-bottom: 0.35rem;
}

.wysiwyg-editor a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.wysiwyg-editor blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding: 0.6rem 1rem;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 0 10px 10px 0;
  margin: 1rem 0;
  font-style: italic;
  color: #cbd5e1;
}

.editor-embedded-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin: 1rem 0;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.editor-embedded-img:hover {
  transform: scale(1.01);
  border-color: var(--accent-cyan);
}

.img-uploading-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.5rem 0;
  animation: pulseUploading 1.2s infinite ease-in-out;
}

@keyframes pulseUploading {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

