/* Reset & base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Full-screen map */
#map {
  width: 100%;
  height: 100%;
}

/* Floating add button */
#add-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #1a73e8;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
}

#add-btn:hover {
  background: #1558b0;
  transform: scale(1.08);
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
  display: none;
}

/* Modal box */
.modal {
  position: relative;
  width: 80vw;
  max-width: 900px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

/* Detail modal */
#detail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#detail-images img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* Form elements */
form label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

form input[type="text"],
form input[type="password"],
form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

form input[type="file"] {
  margin-top: 0.25rem;
}

form small {
  display: block;
  margin-top: 0.25rem;
  color: #888;
  font-size: 0.8rem;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1558b0;
}

.btn-primary:disabled {
  background: #a0c4f1;
  cursor: not-allowed;
}

.btn-danger {
  padding: 0.5rem 1.25rem;
  background: #d93025;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: #b3261e;
}

/* Auth-hidden elements */
.auth-hidden {
  display: none !important;
}

/* Logout button */
#logout-btn {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
  padding: 0.4rem 0.9rem;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

#logout-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Smaller modal variant for auth */
.modal.modal-sm {
  width: 90vw;
  max-width: 400px;
}

/* Form status message */
.form-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: #444;
}

.form-status.hidden {
  display: none;
}

.form-status.error {
  color: #d93025;
}

/* Form error message */
.form-error {
  color: #d93025;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.form-error.hidden {
  display: none;
}
