:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

body {
  margin: 0;
  background-color: #f1f5f9;
}

.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar {
  width: 240px;
  background-color: #0f172a;
  color: #fff;
  padding: 2rem 1rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar h1 {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.sidebar a {
  color: #e2e8f0;
  text-decoration: none;
  display: block;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.sidebar a.active,
.sidebar a:hover {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
}

.content {
  flex: 1;
  padding: 2rem;
  background: #fff;
  margin-left: 240px;
  width: calc(100% - 240px);
}

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

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

/* Mobile styles */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

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

  .content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 4rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card > div[style*="display:flex"] {
    gap: 0.75rem;
  }

  .card > div[style*="display:flex"] p {
    font-size: 0.9rem;
    margin-top: 0.25rem;
  }

  table {
    font-size: 0.875rem;
  }

  table th,
  table td {
    padding: 0.625rem;
  }

  /* Smaller photos on tablet */
  table td[data-label="Photos"] img,
  table td[data-label="Photo"] img {
    width: 60px;
    height: 45px;
  }

  table td[data-label="Photos"] > div,
  table td[data-label="Photo"] > div {
    width: 60px;
    height: 45px;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 0.75rem;
    padding-top: 4rem;
  }

  .card {
    padding: 1rem;
    border-radius: 0.5rem;
  }

  /* Page header improvements */
  .card > div[style*="display:flex"] {
    margin-bottom: 1rem;
  }

  .card > div[style*="display:flex"] p {
    font-size: 0.85rem;
    margin-top: 0.25rem;
  }

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

  table {
    font-size: 0.875rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0;
  }

  table thead,
  table tbody,
  table tr {
    display: block;
  }

  table thead {
    display: none;
  }

  table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  table tr {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-bottom: 0;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
  }

  table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
    font-size: 0.8rem;
    min-width: 80px;
    flex-shrink: 0;
  }

  /* Hide less important columns on mobile */
  table td[data-label="Created"],
  table td[data-label="Coordinates"],
  table td[data-label="what3words"] {
    font-size: 0.8rem;
    color: #64748b;
  }

  /* Photo improvements */
  table td[data-label="Photos"] img,
  table td[data-label="Photo"] img {
    width: 50px;
    height: 40px;
    border-radius: 0.35rem;
  }

  table td[data-label="Photos"] > div,
  table td[data-label="Photo"] > div {
    width: 50px;
    height: 40px;
    font-size: 0.65rem;
  }

  /* Description truncation */
  table td[data-label="Description"] {
    max-width: 100%;
  }

  table td[data-label="Description"]::after {
    content: '';
    flex: 1;
  }

  /* Actions column */
  table td[data-label="Actions"] {
    justify-content: flex-end;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
  }

  table td[data-label="Actions"]::before {
    display: none;
  }

  table td[data-label="Actions"] > div {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
  }

  table td[data-label="Actions"] form {
    display: inline;
  }

  table td[data-label="Actions"] button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
    margin-bottom: 0;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  h2 {
    font-size: 1.5rem;
  }

  .alert {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* Truncate long text */
  table td {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  table td a {
    text-decoration: none;
    color: #0ea5e9;
    font-weight: 500;
  }
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* Responsive flex containers */
@media (max-width: 768px) {
  .card > div[style*="display:flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.07);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: #0ea5e9;
  color: #fff;
}

.btn-secondary {
  background: #0f172a;
  color: #fff;
}

.btn-outline {
  border: 1px solid #cbd5f5;
  color: #0f172a;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
}

.form-group {
  margin-bottom: 1rem;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  font-size: 1rem;
}

.error-text {
  color: #dc2626;
  font-size: 0.9rem;
}

.map-container {
  width: 100%;
  height: 500px;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Custom marker styles */
.custom-marker {
  background: transparent !important;
  border: none !important;
}

@media (max-width: 768px) {
  .map-container {
    height: 400px;
    border-radius: 0.5rem;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 300px;
    margin-bottom: 1rem;
  }

  /* Hide less important columns on mobile */
  .mobile-hide {
    display: none !important;
  }

  /* Better table header spacing */
  table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
}

/* Tablet improvements */
@media (max-width: 768px) and (min-width: 481px) {
  .mobile-hide {
    display: table-cell;
  }

  /* Truncate long descriptions on tablet */
  table td[data-label="Description"] {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Confirmation Modal */
.confirm-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.confirm-modal-overlay.active {
  display: flex;
}

.confirm-modal {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-modal h3 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: #0f172a;
}

.confirm-modal p {
  margin: 0 0 1.5rem;
  color: #64748b;
  line-height: 1.6;
}

.confirm-modal .warning-text {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #92400e;
  font-size: 0.9rem;
}

.confirm-modal .modal-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.confirm-modal .btn-cancel {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.confirm-modal .btn-cancel:hover {
  background: #e2e8f0;
}

.confirm-modal .btn-confirm-delete {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}

.confirm-modal .btn-confirm-delete:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

@media (max-width: 480px) {
  .confirm-modal {
    padding: 1.5rem;
  }

  .confirm-modal h3 {
    font-size: 1.25rem;
  }

  .confirm-modal .modal-buttons {
    flex-direction: column;
  }

  .confirm-modal .modal-buttons button {
    width: 100%;
  }
}

