/* ==========================================
   S Travel Admin Panel - Global Styles
   ========================================== */

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

:root {
  --primary: #E8A844;
  --primary-hover: #D4962E;
  --primary-light: #F5D89A;
  --bg-cream: #FFF8F0;
  --bg-gradient: linear-gradient(180deg, #FFF3E4 0%, #FFF8F0 50%, #FFF3E4 100%);
  --card-bg: #FFFFFF;
  --card-border: #E8E8E8;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --text-primary: #2D2D2D;
  --text-secondary: #888888;
  --text-label: #444444;
  --danger: #E74C3C;
  --danger-hover: #C0392B;
  --success: #27AE60;
  --sidebar-width: 280px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-cream);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ==========================================
   Auth Pages (Welcome, Login, Register)
   ========================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 48px 40px;
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.auth-logo {
  width: 120px;
  height: auto;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* Welcome page specific */
.welcome-container {
  text-align: center;
}

.welcome-container .auth-logo {
  width: 160px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.welcome-container .auth-title {
  font-size: 36px;
  margin-top: 8px;
}

.welcome-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline {
  background: var(--card-bg);
  color: var(--text-primary);
  border-color: var(--card-border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
  padding: 8px 12px;
}

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

.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.btn-icon:hover {
  border-color: var(--primary);
}

.btn-icon.save {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-full {
  width: 100%;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #BBBBBB;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-helper {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ==========================================
   Dashboard Layout
   ========================================== */

.dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px;
  text-align: center;
  border-bottom: 1px solid var(--card-border);
}

.sidebar-logo img {
  width: 140px;
  height: auto;
}

.sidebar-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 4px;
}

.menu-header svg {
  transition: transform 0.2s;
}

.menu-header.collapsed svg {
  transform: rotate(-90deg);
}

.menu-items {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.menu-item:hover {
  background: #FFF3E4;
}

.menu-item.active {
  background: var(--primary);
  color: #FFFFFF;
}

.menu-item .icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.menu-divider {
  height: 1px;
  background: var(--card-border);
  margin: 8px 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--card-border);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.logout-btn:hover {
  background: #FFF3E4;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px;
  background: var(--bg-cream);
  min-height: 100vh;
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--card-shadow);
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.content-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* List Items */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.list-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.list-item-info,
.list-item-content {
  flex: 1;
  text-align: left;
}

.list-item-name {
  font-size: 16px;
  font-weight: 600;
}

.list-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.list-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 8px 12px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.drag-handle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.drag-handle:active {
  cursor: grabbing;
}

.list-item.dragging {
  opacity: 0.4;
  background: #FFF3E4;
}

.list-item.drag-over {
  border-top: 2px solid var(--primary);
}

/* Inline edit mode */
.list-item.editing {
  background: #FFFDF8;
}

.list-item.editing .edit-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: var(--font);
}

.list-item.editing .edit-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* Gallery upload */
.gallery-upload {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.gallery-upload:hover {
  border-color: var(--primary);
}

.gallery-upload input[type="file"] {
  display: none;
}

.gallery-upload-label {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
}

.gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.gallery-preview-item {
  position: relative;
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.gallery-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-preview-item .remove-img {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rich text area for price list */
.rich-paste-area {
  width: 100%;
  min-height: 150px;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--card-bg);
  overflow: auto;
}

.rich-paste-area:focus {
  outline: none;
  border-color: var(--primary);
}

.rich-paste-area,
.rich-paste-area * {
  font-family: var(--font) !important;
  font-size: 14px !important;
  color: var(--text-primary) !important;
}

.rich-paste-area b,
.rich-paste-area strong {
  font-weight: 700 !important;
}

.rich-paste-area i,
.rich-paste-area em {
  font-style: italic !important;
}

.toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--card-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: #F9F9F9;
}

.toolbar + .rich-paste-area {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.rich-paste-area:empty::before,
.rich-paste-area.empty::before {
  content: attr(data-placeholder);
  color: #BBBBBB;
  pointer-events: none;
}

.rich-paste-area table {
  border-collapse: collapse;
  width: 100%;
}

.rich-paste-area td,
.rich-paste-area th {
  border: 1px solid #ccc;
  padding: 6px 10px;
  font-size: 13px;
}

/* Toast notification */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

/* Confirm dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.modal-dialog h3 {
  margin-bottom: 12px;
}

.modal-dialog p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--card-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .welcome-buttons {
    flex-direction: column;
  }

  .auth-card {
    padding: 32px 24px;
  }
}
