/* ---------- Base ---------- */

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6fb;
  color: #1f2937;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.loading-indicator {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
  background: #111827;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  font-weight: bold;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.loading-indicator::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

/* ---------- Header ---------- */

.site-header {
  background: linear-gradient(135deg, #111827, #312e81);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.site-header h1 {
  margin: 0;
  font-size: 2.5rem;
}

.site-header p {
  color: #d1d5db;
}

nav {
  margin-top: 1rem;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 1rem;
  font-weight: bold;
}

.auth-panel {
  margin-top: 1.25rem;
}

.session-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.session-info span {
  font-weight: bold;
}

.auth-panel .secondary-btn {
  display: inline-block;
  text-decoration: none;
}

.auth-page {
  max-width: 520px;
}

.auth-card h2 {
  margin-top: 0;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Toolbar ---------- */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.toolbar h2 {
  margin-bottom: 0.25rem;
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.update-indicator {
  display: block;
  margin: 0 auto 1.5rem;
}

/* ---------- Buttons ---------- */

.primary-btn,
.secondary-btn,
.danger-btn {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s, opacity 0.2s;
}

.primary-btn {
  background: #4f46e5;
  color: white;
}

.secondary-btn {
  background: white;
  border: 1px solid #d1d5db;
  color: #111827;
}

.danger-btn {
  background: #ef4444;
  color: white;
}

.icon-danger-btn {
  border: none;
  background-color: transparent;
  background-image: url("../assets/delete.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 6rem 6rem;
  width: 5rem;
  height: 5rem;
  cursor: pointer;
}

.icon-danger-btn:hover {
  background-color: #fee2e2;
  border-radius: 0.5rem;
}

.more-btn {
  background: none;
  border: none;
  color: #4f46e5;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Cards ---------- */

.form-card,
.image-card,
.empty-state {
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
  /* animation: fadeUp 0.35s ease; */
}

.empty-state {
  text-align: center;
  color: #6b7280;
}

.gallery-card h2 {
  margin-top: 0;
}

.gallery-card small {
  display: block;
  color: #6b7280;
  margin-bottom: 1rem;
}

/* ---------- Forms ---------- */

form {
  display: grid;
  gap: 1rem;
}

label {
  font-weight: bold;
}

input,
textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

/* ---------- Gallery ---------- */

.gallery-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.image-card img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #111827;
  border-radius: 1rem;
}

.image-info {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.image-info h2 {
  margin: 0;
}

.image-info p {
  margin-top: 0.3rem;
  color: #6b7280;
}

/* ---------- Comments ---------- */

.comment-form {
  margin-top: 1rem;
}

.comments {
  margin-top: 1.2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.comment {
  background: #f9fafb;
  border-radius: 0.8rem;
  padding: 0.8rem;
  margin-bottom: 0.7rem;
}

.comment strong {
  display: block;
}

.comment small {
  color: #6b7280;
}

/* ---------- Comment Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(700px, 95%);
  max-height: 85vh;
  overflow-y: auto;
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  animation: fadeUp 0.3s ease;
}

.modal-box h2 {
  margin: 0;
}

.modal-header,
.comment-page-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.comment-page-controls {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

/* ---------- Animation ---------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

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

/* ---------- Mobile ---------- */

@media screen and (max-width: 576px) {
  .toolbar,
  .image-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header h1 {
    font-size: 2rem;
  }
}
