/* ─── Admin Panel Responsive ─────────────────────────────────────────── */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --success: #10b981;
  --rad: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --header-h: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  padding-bottom: 120px;
  display: flex;
}

/* ── Mobile Header ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.menu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
}

/* ── Sidebar ── */
.sidebar {
  width: 250px;
  background: var(--card);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1100;
  transition: transform 0.3s ease;
}

.brand-title {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--primary);
  padding-left: 12px;
  margin-bottom: 24px;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 0.2s;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.nav-btn.active {
  background: #eff6ff;
  color: var(--primary);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Main Content ── */
.main-content {
  margin-left: 250px;
  padding: 40px;
  width: calc(100% - 250px);
  max-width: 1000px;
  transition: 0.3s;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.subtitle {
  color: #64748b;
  margin-bottom: 32px;
}

.panel-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--card);
  border-radius: var(--rad);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Form Elements ── */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #475569;
}

input,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  background: #f8fafc;
  transition: 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Language Tabs ── */
.lang-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
}

.l-tab {
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748b;
}

.l-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* ── Buttons ── */
.btn {
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
}

.btn-full {
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: #eff6ff;
}

.btn-delete {
  background: white;
  color: #ef4444;
  border: 1px solid #ef4444;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-delete:hover {
  background: #fef2f2;
  transform: none;
}

.btn-move {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 0.9rem;
}

.btn-move:hover:not(:disabled) {
  background: #f1f5f9;
  transform: none;
}

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

/* ── Status Bar ── */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 250px;
  width: calc(100% - 250px);
  background: white;
  border-top: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #64748b;
  font-size: 0.9rem;
}

.save-status.ok {
  color: var(--success);
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #10b981;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-20px);
  animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ── Login ── */
#loginOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f172a;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.login-box {
  background: white;
  color: #1e293b;
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
}

/* ── Upload & Gallery Grid ── */
.upload-area {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.file-input-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.gal-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.gal-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal-thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.2s ease;
}

.gal-thumb-del:hover {
  transform: scale(1.1);
  background: #ef4444;
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 80px 20px 140px;
  }

  .mobile-header {
    display: flex;
  }

  .status-bar {
    left: 0;
    width: 100%;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    height: auto;
  }

  .status-bar div:last-child {
    width: 100%;
    flex-direction: column;
  }

  .status-bar .btn {
    width: 100%;
  }

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

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }

  .sidebar-overlay.open {
    display: block;
  }
}