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

:root {
  --background: #ffffff;
  --text: #000000;
  --text-muted: #666666;
  --border: #e1e4e8;
  --card: #f6f8fa;
  --hover-bg: #e1e4e8;
}

/* Dark theme variables */
body.dark-theme {
  --background: #0d1117;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --border: #30363d;
  --card: #161b22;
  --hover-bg: #21262d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
}

/* Modern trashcan list styles for trashcans.php */
.trashcan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.trashcan-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: box-shadow .2s;
  cursor: pointer;
}
.trashcan-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.trashcan-icon {
  font-size: 2rem;
  margin-bottom: .5rem;
}
.trashcan-name {
  font-weight: bold;
  margin-bottom: .3rem;
}
.trashcan-status {
  font-size: .95rem;
  margin-top: .2rem;
}
/* Remove duplicate styles for specific modal ID as we use classes now */
/* Modern trashcan list styles for dashboard */
.trashcan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.trashcan-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: box-shadow .2s;
}
.trashcan-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.trashcan-icon {
  font-size: 2rem;
  margin-bottom: .5rem;
}
.trashcan-name {
  font-weight: bold;
  margin-bottom: .3rem;
}
.trashcan-status {
  font-size: .95rem;
  margin-top: .2rem;
}
:root { --bg:#2e2e2e; --card:#111722; --text:#e6edf3; --muted:#a0a8b3; --accent:#87b6ff; --danger:#ff7080;  --badge-bg: #172235; --badge-text: #9ec1ff;}
*{box-sizing:border-box}
body{margin:0;font:16px/1.5 system-ui;background:var(--bg);color:var(--text)}
a{color:var(--accent);text-decoration:none}

.theme-toggle,
body.light .theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #1f2733;
    background: #0e1622;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

body.dark-theme .theme-toggle {
    background: #ffffff !important;
    border: 1px solid #e1e4e8 !important;
    color: #1f2733 !important;
}

.theme-toggle:hover,
body.light .theme-toggle:hover {
    transform: scale(1.1);
    background: #131f2e;
    border-color: #2a3441;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

body.dark-theme .theme-toggle:hover {
    transform: scale(1.1);
    background: #f6f8fa !important;
    border-color: #d1d5da !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.1) !important;
}
.container{
    max-width:1100px;
    margin:2rem auto;
    padding:0 1rem;
    position: relative;
}
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 998;
    height: 64px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.header-logo {
    margin-left: 240px;
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed + .header-logo {
    margin-left: 64px;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--card);
    border-right: 1px solid var(--border);
    width: 240px;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-collapse {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.collapsed .sidebar-collapse {
    transform: rotate(180deg);
}

.nav-links {
    padding: 1rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--hover-bg);
}

.nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 1rem;
}

.collapsed .nav-text {
    display: none;
}

/* Tooltip for collapsed sidebar nav items */
.nav-link[data-tooltip] {
  position: relative;
}

/* Hidden by default */
.nav-link[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10000;
  pointer-events: none;
}

/* Tooltip styled by theme: use accent for background and card for text to ensure contrast */
.nav-link[data-tooltip]::after {
  background: var(--accent);
  color: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
}

/* Show tooltip when sidebar is collapsed and the item is hovered */
.sidebar.collapsed .nav-link[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Slight different look for light theme */
body.light .nav-link[data-tooltip]::after {
  background: var(--accent);
  color: var(--card);
}

/* Ensure tooltips don't show when sidebar is expanded (optional) */
.sidebar:not(.collapsed) .nav-link[data-tooltip]::after {
  display: none;
}

.nav-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.nav-section-title {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.logout {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Adjust main content for sidebar */
.container {
    
    padding-top: calc(0px + 1rem);
    transition: margin-left 0.3s ease;
    max-width: 1100px;
    margin-right: auto;
    padding-right: 2rem;
    padding-left: 2rem;
}

.container.sidebar-collapsed {
    margin-left: 64px;
}

.page-title {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text); 
}

.header-logo {
    max-width: 256px;
    margin-right: 1rem;
}

.header-logo .logo_image {
    width: 256px;
    height: 95px;
    background-image: url('/assets/images/willowbrook-maintenance-logo-512x189-clean.png');
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 1000;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text);
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: var(--hover-bg);
}
h1,h2{margin:0 0 .6rem}

.login_container {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.login_logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo_image {
  width: 512px;
  height: 189px;
  max-width: 100%;
  background-image: url('/assets/images/willowbrook-maintenance-logo-512x189.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0 auto;
}
label{display:block;margin:.4rem 0 .2rem}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .sidebar-toggle {
        display: block;
    }

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

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

    .container {
        margin-left: 0 !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-logo {
        margin-left: 0;
    }

    .header-logo .logo_image {
        width: 180px;
        height: 66px;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

/* Logo positioning */
.sidebar-logo {
    flex: 1;
    padding: 0.5rem;
    overflow: hidden;
  transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-logo .logo_image {
    width: 180px;
    height: 66px;
  background-image: url('/assets/images/willowbrook-maintenance-logo-512x189-clean.png');
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat;
}

/* Topbar duplicate logo that slides behind the sidebar */
.topbar-logo {
  position: absolute;
  left: 64px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.3s ease;
  z-index: 996; /* below sidebar (999) so it can be covered */
  pointer-events: none;
  width: 180px;
  height: 66px;
}

.topbar-logo .logo_image {
  width: 100%;
  height: 100%;
  background-image: url('/assets/images/willowbrook-maintenance-logo-512x189-clean.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}

/* When the sidebar is expanded (not collapsed) move the topbar logo left so it sits under the sidebar */
.sidebar:not(.collapsed) ~ .topbar-logo {
  transform: translateY(-50%) translateX(-240px);
}

/* When the sidebar is collapsed, keep the topbar logo visible */
.sidebar.collapsed ~ .topbar-logo {
  transform: translateY(-50%) translateX(0);
}


.sidebar.collapsed .sidebar-logo {
  /* Remove from layout entirely when collapsed so it doesn't shift the collapse button */
  display: none !important;
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

/* When expanded ensure logo fades in */
.sidebar .sidebar-logo {
  opacity: 1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* DARK THEME */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea,
body.dark-theme button:not(.theme-toggle) {
  width:100%;
  padding:.6rem;
  border-radius:10px;
  border:1px solid #1f2733;
  background:#0e1622;
  color:var(--text);
}
body.dark-theme button { cursor:pointer; }
body.dark-theme button.danger {
  background:#1f0d12;
  border-color:#43121f;
  color:#ff9aa7;
}
body.dark-theme .alert {
  background:#2a0f11;
  border:1px solid #4a1b1f;
  color:var(--danger);
  padding:.6rem;
  border-radius:10px;
  margin:.6rem 0;
}

/* LIGHT THEME */
body.light input,
body.light select,
body.light textarea,
body.light button {
  width:auto;
  padding:.6rem;
  border-radius:10px;
  border:1px solid #bcd0ee;
  background:#fff;
  color:var(--text);
}
body.light button { cursor:pointer; }
body.light button.danger {
  background:#fbeaea;
  border-color:#d9534f;
  color:#d9534f;
}
body.light .alert {
  background:#fbeaea;
  border:1px solid #d9534f;
  color:#d9534f;
  padding:.6rem;
  border-radius:10px;
  margin:.6rem 0;
}
.card {
  background: var(--card);
  padding: 1rem;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  margin-bottom: 1rem;
}
.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transform: translateY(-2px);
  transition: all .2s ease;
}
.badge {
  display:inline-block;
  padding:.2rem .5rem;
  border-radius:999px;
  background:var(--badge-bg);
  color:var(--badge-text);
  border:1px solid #24324a;
}

.muted{color:var(--muted);font-size:.9rem}
#map{height:70vh;border-radius:14px;overflow:hidden;border:1px solid #1f2733}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal .dialog {
  background: var(--card);
  max-width: 800px;
  width: 100%;
  border-radius: 14px;
  padding: 1.5rem;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal.show .dialog {
  transform: translateY(0);
}

/* Modal Backdrop Click */
.modal {
  cursor: pointer; /* indicate clickable */
}

.modal .dialog {
  cursor: default; /* reset cursor */
}

/* Dialog Footer */
.dialog-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--badge-bg);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.dialog-footer button {
  min-width: 120px;
}

/* Location Panel */
.location-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.coords-display {
  flex: 1;
  padding: 0.8rem;
  background: var(--badge-bg);
  border-radius: 8px;
  font-family: monospace;
}

/* Update marker animation */
@keyframes markerPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.modal button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  width: auto;
  font-weight: 500;
}

.modal hr {
  border: none;
  border-top: 1px solid var(--badge-bg);
  margin: 1rem 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
  gap: .5rem;
  margin-top: 1rem;
}
.photo-grid img{width:100%;border-radius:10px}
.form-inline{display:flex;gap:.5rem;align-items:end}
.login_container{max-width: 533px;margin: 4rem auto;padding: 1rem 1rem;}

/* Trashcan Management Grid */
/* Trashcan Table Styles */
.trashcan-table-wrapper {
  margin: 1rem 0;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
}

.trashcan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.trashcan-table th {
  background: rgba(0,0,0,.1);
  text-align: left;
  padding: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.9rem;
}

.trashcan-table td {
  padding: 0.8rem;
  border-top: 1px solid rgba(255,255,255,.1);
  vertical-align: middle;
}

.trashcan-table tr.clickable {
  cursor: pointer;
  transition: background-color 0.2s;
}

.trashcan-table tr.clickable:hover {
  background: rgba(255,255,255,.03);
}

.trashcan-table .minimap {
  height: 120px;
  width: 180px;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
}

.trashcan-table .coords {
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.trashcan-table .record-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.trashcan-table .record-count .number {
  font-size: 1.2rem;
  font-weight: 500;
}

.trashcan-table .record-count .label {
  font-size: 0.85rem;
  color: var(--muted);
}

.trashcan-table .badge {
  padding: 0.3rem 0.7rem;
}

/* Add Trashcan Button Cell */
.add-trashcan-cell {
  background: var(--badge-bg);
  text-align: center;
  padding: 1rem !important;
}

.add-button {
  background: var(--accent);
  color: var(--card);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.add-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Form Styling */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
}

.location-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.coords-display {
  flex: 1;
  padding: 0.6rem;
  background: var(--badge-bg);
  border-radius: 8px;
  color: var(--muted);
}

.location-btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-buttons button {
  flex: 1;
  padding: 0.8rem;
}

button.secondary {
  background: var(--badge-bg);
  color: var(--text);
  border: 1px solid var(--muted);
}

button.secondary:hover {
  background: var(--card);
}

/* Form improvements */
.form-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.form-buttons button {
  flex: 1;
}

textarea {
  width: 100%;
  min-height: 80px;
  margin: 0.3rem 0 1rem;
  font-family: inherit;
}

/* Record styles */
.record {
  background: var(--card);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.record .notes {
  margin-top: 0.5rem;
  color: var(--muted);
}

.buttons {
  display: flex;
  gap: 0.5rem;
}

.buttons button {
  flex: 1;
}

/* Light theme overrides */
body.light {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #111;
  --muted: #555;
  --accent: #2c7be5;
  --danger: #d9534f;
    --badge-bg: #e9f2ff;
  --badge-text: #2c7be5;
}

/* Toggle button */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--card);
  border: 1px solid #ccc;
  border-radius: 50px;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
