/* editor.css — RiverSolJax Staff Web Editor
   Design matches: #90EE90 (green), white cards, Inter font, same spacing system */

/* ── RESET & BASE ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #f0f4f0;
  color: #222;
  min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────────────────────────── */
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  background: #fff;
  border-bottom: 3px solid #90EE90;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  position: sticky;
  top: 0;
  z-index: 100;
}

.editor-header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.editor-logo {
  height: 38px;
  width: auto;
}

.editor-header__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
}

.editor-header__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ccc;
  display: inline-block;
  transition: background 0.3s;
}

.status-dot.connected    { background: #4CAF50; }
.status-dot.error        { background: #e53935; }
.status-dot.saving       { background: #FFA726; }

/* ── LAYOUT ────────────────────────────────────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 62px);
}

/* ── SIDEBAR ───────────────────────────────────────────────────────────────── */
.editor-sidebar {
  background: #fff;
  border-right: 1px solid #e8ece8;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #999;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #444;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.18s, color 0.18s;
}

.sidebar-btn:hover {
  background: #e8f5e9;
  color: #222;
}

.sidebar-btn.active {
  background: #90EE90;
  color: #222;
  font-weight: 700;
}

/* ── MAIN CONTENT ──────────────────────────────────────────────────────────── */
.editor-main {
  padding: 2.5rem 2rem;
  max-width: 1000px;
  width: 100%;
}

/* ── PANELS ────────────────────────────────────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

.panel-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.panel-subtitle {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ── DASHBOARD CARDS ───────────────────────────────────────────────────────── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.dash-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.dash-card:hover {
  transform: translateY(-4px);
  border-color: #90EE90;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.dash-card__icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.dash-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.dash-card p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

/* ── PLANS GRID ────────────────────────────────────────────────────────────── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.plan-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
  border-left: 5px solid #90EE90;
}

.plan-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.price-row label {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 80px;
  color: #444;
}

.price-input {
  width: 90px;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.price-input:focus {
  outline: none;
  border-color: #90EE90;
}

.plan-desc-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: 'Inter', sans-serif;
  margin-top: 0.3rem;
  transition: border-color 0.2s;
}

.plan-desc-input:focus {
  outline: none;
  border-color: #90EE90;
}

/* ── MENU TABS ─────────────────────────────────────────────────────────────── */
.menu-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.menu-tab {
  padding: 0.6rem 1.2rem;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}

.menu-tab:hover {
  border-color: #90EE90;
  color: #222;
}

.menu-tab.active {
  background: #90EE90;
  border-color: #90EE90;
  color: #222;
}

/* ── MENU ITEM LIST ────────────────────────────────────────────────────────── */
.menu-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  overflow: hidden;
  margin-bottom: 1rem;
  min-height: 120px;
}

.menu-item-row {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #f0f0f0;
  gap: 1rem;
  transition: background 0.15s;
}

.menu-item-row:last-child { border-bottom: none; }
.menu-item-row:hover { background: #f9fdf9; }

.menu-item-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.menu-item-price {
  font-size: 0.88rem;
  color: #555;
  min-width: 80px;
}

.btn-edit, .btn-delete {
  padding: 0.38rem 0.9rem;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}

.btn-edit   { background: #e8f5e9; color: #2e7d32; }
.btn-delete { background: #fdecea; color: #c62828; margin-left: 0.3rem; }
.btn-edit:hover, .btn-delete:hover { opacity: 0.8; }

.empty-state {
  text-align: center;
  color: #aaa;
  padding: 2.5rem;
  font-size: 0.95rem;
}

/* ── FORM ELEMENTS ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  background: #fff;
}

.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
  background: #fff;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: #90EE90;
}

.img-preview {
  margin-top: 0.7rem;
  max-width: 320px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── TERMS EDITOR ──────────────────────────────────────────────────────────── */
.terms-section-block {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  border-left: 5px solid #90EE90;
}

.terms-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terms-lock-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: #f0f0f0;
  color: #888;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* ── ACTION BAR ────────────────────────────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.save-msg {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.2rem;
  transition: opacity 0.3s;
}

.save-msg.success { color: #2e7d32; }
.save-msg.error   { color: #c62828; }

/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}

.btn--primary {
  background: #90EE90;
  color: #222;
}
.btn--primary:hover { background: #7cd17c; transform: translateY(-1px); }

.btn--green {
  background: #4CAF50;
  color: #fff;
}
.btn--green:hover { background: #388e3c; }

.btn--ghost {
  background: #f0f0f0;
  color: #444;
}
.btn--ghost:hover { background: #e0e0e0; }

.btn--danger {
  background: #e53935;
  color: #fff;
}
.btn--danger:hover { background: #c62828; }

/* ── MODAL ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── TOAST ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #222;
  color: #fff;
  padding: 0.9rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 9999;
  animation: slideUp 0.25s ease;
}

.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }

/* ── ANIMATIONS ────────────────────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; }              to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    border-right: none;
    border-bottom: 1px solid #e8ece8;
    padding: 0.8rem;
  }
  .sidebar-label { display: none; }
  .sidebar-btn   { width: auto; padding: 0.5rem 0.8rem; font-size: 0.82rem; }
  .editor-main   { padding: 1.5rem 1rem; }
  .dash-cards    { grid-template-columns: 1fr 1fr; }
}

/* ── LOGIN OVERLAY ─────────────────────────────────────────────────────────── */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#login-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 250px;
  text-align: center;
}

#login-box input {
  padding: 10px;
  font-size: 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}

#login-box button {
  padding: 10px;
  cursor: pointer;
  background: #90EE90;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
}

#login-box button:hover {
  background: #7cd17c;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-8px); }
  80%       { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease;
}