/* Admin layout polish */
.admin {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  background: #f3f4f6;
  border-radius: 12px;
}

/* Headings */
.admin h1 {
  margin-top: 0;
}

/* Section spacing */
.admin h2 {
  margin-top: 2.5rem;
}

/* Lists */
.admin ul {
  padding-left: 1.25rem;
}

.admin li {
  margin: 0.4rem 0;
}

/* Forms */
.admin form {
  margin-top: 1.5rem;
}


/* Danger areas */
.admin .danger-zone {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #ddd;
}

/* Upload page layout */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.upload-card {
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 4px;
  background: #fafafa;
}

.upload-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

/* Forms inside upload cards */
.upload-card form {
  margin-top: 1rem;
}

.upload-card button {
  margin-top: 1rem;
}

/* Responsive fallback */
@media (max-width: 800px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}

.upload-card input[type="file"] {
  margin-top: 0.5rem;
}

/* test 1139a */

/* Photo admin grid — 4 columns */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1000px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

.photo-item {
  border: 1px solid #ddd;
  padding: 1rem;
  background: #fafafa;
  border-radius: 4px;
}

.photo-item img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 0.75rem;
}

.photo-item form {
  margin-top: 0.5rem;
}

.photo-item label {
  font-weight: 600;
  font-size: 0.9rem;
}

.photo-item textarea,
.photo-item input[type="text"] {
  width: 100%;
  font-size: 0.9rem;
}

.photo-item button {
  margin-top: 0.5rem;
}

.photo-item {
  position: relative; /* required for badge positioning */
}

/* Hidden by default */
.unsaved-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* When unsaved */
.photo-item.unsaved .unsaved-badge {
  opacity: 1;
  transform: translateY(0);
}

.deleted-photo-list {
  margin-top: 1.5rem;
}

.deleted-photo {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid #ddd;
}

.deleted-photo img {
  max-width: 120px;
  height: auto;
}

.deleted-photo .meta {
  flex: 1;
}

/* Inline admin actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.actions form.inline {
  display: inline;
  margin: 0;
}


.actions .danger button:hover {
  background: #8c0018;
}

/* Deleted events */
.deleted-events .event {
  opacity: 0.6;
  border-left: 4px solid #b00020;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.access-group {
  border: 1px solid #ddd;
  padding: 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  background: #fafafa;
}

.access-group h2 {
  margin: 0;
}

.access-group .meta {
  margin-bottom: 0.75rem;
}

.status-unpublished {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: #b00020;
  font-weight: 600;
}

/* ================================
   Rounded Admin Photo Cards
================================ */

.photo-item {
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e2e2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  padding: 1rem;
}

/* Center image nicely */
.photo-item img {
  display: block;
  margin: 0 auto 0.75rem auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}

/* Inputs + textarea consistent typography */
.photo-item input[type="text"],
.photo-item textarea {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}

/* Fix textarea look */
.photo-item textarea {
  resize: vertical;
  min-height: 4rem;
}

.photo-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

/* Button row layout */
.button-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.6rem;
}

/* Small rounded buttons */
.button-row button {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.05s ease;
}

/* Save button (blue) */
.button-row .primary {
  background: #1f6feb;
  color: white;
}

.button-row .primary:hover {
  background: #175cd3;
}

/* Delete button (red) */
.button-row .danger {
  background: #d93025;
  color: white;
}

.button-row .danger:hover {
  background: #b3261e;
}

/* Slight press effect */
.button-row button:active {
  transform: translateY(1px);
}



.photo-item {
  cursor: grab;
}

.photo-item:active {
  cursor: grabbing;
}


/* ================================
   Admin Event Cards
================================ */

.admin-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
  margin-top: 1.75rem;
}

.admin-event-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.admin-event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.admin-event-image {
  aspect-ratio: 4 / 3;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-event-body {
  padding: 1rem;
}

.admin-event-body h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.admin-event-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}


/* ===============================
   Admin Dashboard
================================ */

.admin-dashboard {
  padding: 1rem 0 2rem 0;
}

.admin-header {
  margin-bottom: 1.5rem;
}

.admin-subtitle {
  color: #555;
  margin-top: 0.25rem;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.admin-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.admin-card-icon {
  font-size: 1.8rem;
}

.admin-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-card p {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.4;
}


/* ===============================
   Auth Pages (Login / Logout)
================================ */

.auth-wrapper {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-icon {
  font-size: 2rem;
  text-align: center;
}

.auth-card h1 {
  text-align: center;
  margin: 0;
}

.auth-subtitle {
  text-align: center;
  color: #555;
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-card input {
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
}

.btn.full {
  width: 100%;
  text-align: center;
}

.auth-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

/* ===============================
   Admin Mode Banner
================================ */

.admin-banner {
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.55rem 1.5rem;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-banner-left strong {
  font-weight: 600;
}

.admin-banner-sep {
  color: #bbb;
}

.admin-banner-link {
  font-weight: 600;
  color: #1f6feb;
  text-decoration: none;
}

.admin-banner-link:hover {
  text-decoration: underline;
}

.admin-banner-help {
  color: #666;
  white-space: nowrap;
}

.admin-bar {
  background: #eef2f7;
  border-bottom: 1px solid #dfe3e8;
  font-size: 0.85rem;
}

.admin-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.admin-bar-primary {
  font-weight: 600;
  color: #111;
  text-decoration: none;
}

.admin-bar-primary:hover {
  text-decoration: underline;
}

.admin-bar-status {
  color: #666;
}

.admin-bar-link {
  color: #1f6feb;
  font-weight: 500;
  text-decoration: none;
}

.admin-bar-link:hover {
  text-decoration: underline;
}

.admin-bar-help {
  color: #777;
  white-space: nowrap;
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-card-icon {
  font-size: 1.4rem;
}

/* Wrapper aligns with content width */
.admin-bar-wrapper {
  max-width: 1100px;
  margin: 1rem auto 0 auto;
  padding: 0 1.5rem;
}

/* Actual bar */
.admin-bar {
  background: #eef2f7;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Left group */
.admin-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-bar-primary {
  font-weight: 600;
  color: #111;
  text-decoration: none;
}

.admin-bar-primary:hover {
  text-decoration: underline;
}

.admin-bar-status {
  color: #666;
}

.admin-bar-link {
  color: #1f6feb;
  text-decoration: none;
  font-weight: 500;
}

.admin-bar-link:hover {
  text-decoration: underline;
}

.admin-bar-help {
  color: #777;
  white-space: nowrap;
}


.photo-edit-form.unsaved {
  border: 2px solid #f59e0b;
  border-radius: 10px;
  padding: 0.5rem;
  background: #fffaf0;
  transition: background 0.2s ease;
}

.photo-edit-form.unsaved button[type="submit"] {
  background: #f59e0b;
  color: white;
}


/* ===== EDIT EVENT PAGE ===== */

.admin-form-wrap {
  max-width: 720px;
}

.admin-page-header {
  margin-bottom: 1.5rem;
}

.admin-form .form-group {
  margin-bottom: 1.5rem;
}

.admin-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

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

.form-meta {
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-meta .hint {
  color: #666;
  font-size: 0.9rem;
}

.admin-event-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
}

.left-actions {
  display: flex;
  gap: 1rem;
}


/* ===============================
   Unified Button System
================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;   /* forces consistent height */
  padding: 0 1rem;

  font-size: 0.9rem;
  font-weight: 600;

  border-radius: 10px;
  border: none;
  text-decoration: none;
  cursor: pointer;

  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* Primary (Blue) */
.btn.blue,
.btn.primary {
  background: #1f6feb;
  color: white;
}

.btn.blue:hover,
.btn.primary:hover {
  background: #175cd3;
}

/* Secondary (Gray) */
.btn.gray,
.btn.secondary {
  background: #e5e7eb;
  color: #333;
}

.btn.gray:hover,
.btn.secondary:hover {
  background: #d1d5db;
}

/* Outline */
.btn.outline {
  border: 1px solid #d1d5db;
  background: white;
  color: #444;
}

.btn.outline:hover {
  background: #f3f4f6;
}

/* Danger */
.btn.danger {
  background: #b00020;
  color: white;
}

.btn.danger:hover {
  background: #8a0018;
}

/* ===============================
   Improved Admin Event Card UX
================================ */

.admin-event-card {
  position: relative;
}

.admin-event-image {
  position: relative;
}

.event-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.btn.full {
  width: 100%;
  margin-top: 0.75rem;
}

/* Secondary Links */

.admin-event-links {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.admin-event-links a {
  color: #444;
  text-decoration: none;
  font-weight: 500;
}

.admin-event-links a:hover {
  color: #111;
  text-decoration: underline;
}

/* Card Menu */

.card-menu {
  position: absolute;
  top: 10px;
  right: 12px;
}

.menu-toggle {
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.menu-dropdown {
  position: absolute;
  right: 0;
  margin-top: 6px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.1);
  padding: 0.4rem;
  display: none;
  min-width: 160px;
}

.card-menu:hover .menu-dropdown {
  display: block;
}

.menu-danger {
  background: none;
  border: none;
  color: #b00020;
  padding: 0.5rem 0.75rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.menu-danger:hover {
  background: #fef2f2;
}


/* Secondary Action Row */

.admin-event-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.left-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: nowrap;
}

.left-actions a {
  font-size: 0.9rem;
  font-weight: 500;
  color: #444;
  text-decoration: none;
  white-space: nowrap;
}

.left-actions a:hover {
  color: #111;
  text-decoration: underline;
}

/* Delete styled subtly */

.link-danger {
  background: none;
  border: none;
  color: #b00020;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-danger:hover {
  text-decoration: underline;
}


/* Small subtle action links */
.event-admin-actions a,
.event-admin-actions button {
  font-size: 13px;
  margin-right: 12px;
  text-decoration: none;
}

.admin-event-row {
  display: flex;
  gap: 20px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  align-items: center;
  background: white;
}

.drag-handle {
  cursor: grab;
  font-size: 18px;
}

.admin-event-row:hover {
  background: #f9f9f9;
}

/* === Compress Edit Event Page === */

.admin-form-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px; /* reduced from typical 40+ */
}

.admin-page-header {
  margin-bottom: 18px; /* tighter header */
}

.admin-page-header h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
}

/* Reduce vertical spacing between fields */
.admin-form .form-group {
  margin-bottom: 14px; /* was likely 24–30px */
}

/* Tighten labels */
.admin-form label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

/* Compact inputs */
.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 8px 10px; /* was likely 12–16px */
  font-size: 14px;
  line-height: 1.3;
}

/* Make textarea slightly tighter */
.admin-form textarea {
  min-height: 90px; /* instead of tall default */
}

/* Reduce meta section spacing */
.form-meta {
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.4;
}

/* Compress footer */
.admin-event-footer {
  margin-top: 20px;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Slightly smaller buttons for admin */
.admin-event-footer .btn {
  padding: 8px 14px;
  font-size: 14px;
}