body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}
.app-title { font-weight: 600; }
.app-status { font-size: 0.8rem; color: #a5b4fc; }
main {
  padding: 8px;
}
.panel {
  border-radius: 8px;
  background: #020617;
  padding: 8px;
}
.hidden { display: none !important; }
.map-container {
  width: 100%;
  height: 50vh;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.controls-row {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}
.btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  background: #1e293b;
  color: #e5e7eb;
  font-size: 0.9rem;
}
.btn.primary { background: #0ea5e9; color: #0f172a; }
.btn.secondary { background: #22c55e; color: #022c22; }
.btn.danger { background: #ef4444; color: #450a0a; }
.btn:active { transform: scale(0.98); }
.info-panel {
  margin-top: 4px;
  font-size: 0.85rem;
}
.small-muted {
  font-size: 0.75rem;
  color: #9ca3af;
}
.log-panel {
  margin-top: 8px;
  border-top: 1px solid #1f2933;
}
.log-header {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 4px;
}
.log-body {
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.8rem;
}
.log-body div {
  padding: 2px 0;
  border-bottom: 1px dashed #111827;
}
label {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
}
input[type='email'], input[type='password'], input[type='text'] {  width: 100%; padding: 6px; border-radius: 4px; border: 1px solid #1f2937;  background: #020617; color: #e5e7eb; font-size: 0.9rem; }
.hidden { display:none; }
.photo-counter {
  margin-top: 10px;
  padding: 6px 10px;
  background: #0ea5e933;
  border: 1px solid #0ea5e9;
  border-radius: 6px;
  font-size: 14px;
  color: #0369a1;
  display: inline-block;
}
.map-floating-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: #ffffffdd;
  border-radius: 50%;
  border: none;
  font-size: 20px;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px #0006;
  z-index: 9999;
}

.map-floating-btn:active {
  transform: scale(0.95);
  background: #ffffff;
}

.photo-icon {
    font-size: 28px;
    line-height: 32px;
    text-align: center;
}
.edit-point-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0ea5e9;
  border: 2px solid #0f172a;
}

.edit-photo-icon {
  font-size: 22px;
  text-align: center;
  line-height: 22px;
}

#btnEditInsertPoint.active {
    background: #0ea5e9;
    color: white;
}

.edit-point-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

#editTrashZone.trash-zone {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: rgba(220, 38, 38, 0.85); /* red */
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 22px;
    font-weight: bold;
}

/* ==========================
   PHOTO VIEWER MODAL
=========================== */

.photo-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.photo-modal.hidden {
    display: none;
}

.photo-modal-content {
    background: #1f2937;
    padding: 12px;
    border-radius: 10px;
    max-width: 450px;
    width: 100%;
    color: white;
    position: relative;
}

.photo-modal-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    color: white;
    font-size: 22px;
}

.photo-modal-image {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 14px;
}

.photo-modal-description-block {
    margin-bottom: 12px;
}

.photo-modal-label {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.photo-modal-textarea {
    width: 100%;
    border-radius: 6px;
    padding: 6px;
    font-size: 0.9rem;
}

.photo-modal-actions {
    display: flex;
    justify-content: space-between;
}

.history-bulk-actions {
    background: #1f2937;
    padding: 8px 10px;
    border-bottom: 1px solid #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-bulk-actions.hidden {
    display: none;
}

.history-row {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #374151;
}

.history-row .resume-btn {
    margin-top: 4px;
    font-size: 0.75rem;
    padding: 4px 6px;
}

/* --- Disabled button styling (applies to Start/Pause/Stop too) --- */
.btn:disabled {
  opacity: 0.35;
  filter: grayscale(100%);
  cursor: not-allowed;
}

.btn.primary:disabled,
.btn.secondary:disabled,
.btn.danger:disabled {
  background: #1e293b !important;
  color: #64748b !important;
}

/* Small variant for bulk-bar buttons */
.btn.small {
  flex: 0;
  padding: 4px 6px;
  font-size: 0.8rem;
}

/* --- History list & bulk bar --- */
.history-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  margin-bottom: 6px;
  background: #020617;
  border-radius: 6px;
  border: 1px solid #1f2937;
}

.history-checkbox {
  margin-top: 4px;
  transform: scale(1.1);
}

.history-main {
  flex: 1;
  cursor: pointer;
}

.history-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.history-meta {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Bulk bar at bottom of history panel */
.history-bulk-bar {
  margin-top: 10px;
  padding: 8px;
  border-top: 1px solid #1f2937;
  background: #020617;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-bulk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.single-photo-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1000;
}
.location-toggle {
    margin: 8px;
    padding: 10px 12px;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
.location-toggle:active {
    background: #020617cc;
}
