/* Pipe GIS Photo Inspector - Mobile-First GIS Field Inspection Design */
:root {
  --bg-dark: #0b132b;
  --bg-card: rgba(28, 37, 65, 0.92);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --accent-primary: #38bdf8;
  --accent-hover: #0284c7;
  --accent-glow: rgba(56, 189, 248, 0.35);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --border-radius-lg: 20px;
  --border-radius-sm: 12px;
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(11, 19, 43, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  z-index: 1000;
  flex-shrink: 0;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 14px var(--accent-glow);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(90deg, #f8fafc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

#map-container {
  flex: 1;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-quick-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(11, 19, 43, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--accent-primary);
  color: #0b132b;
}

.inspector-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85dvh;
  height: 52%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--bg-card-border);
  border-radius: 24px 24px 0 0;
  z-index: 990;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 16px 24px 16px;
  gap: 14px;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.6);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  margin: 0 auto 4px auto;
  flex-shrink: 0;
  cursor: pointer;
}

@media (min-width: 769px) {
  .app-main {
    flex-direction: row;
  }

  .inspector-panel {
    position: relative;
    width: 400px;
    height: 100% !important;
    max-height: 100%;
    border-top: none;
    border-left: 1px solid var(--bg-card-border);
    border-radius: 0;
    box-shadow: none;
  }

  .drawer-handle {
    display: none;
  }
}

.panel-card {
  background: rgba(11, 19, 43, 0.65);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--border-radius-lg);
  padding: 14px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #0b132b;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:active {
  transform: scale(0.97);
  filter: brightness(1.15);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--bg-card-border);
}

.btn-secondary:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.16);
}

/* Manual Input Controls */
.manual-input {
  background: rgba(11, 19, 43, 0.8);
  border: 1px solid var(--bg-card-border);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  width: 100%;
}

.manual-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.photo-preview-container {
  width: 100%;
  height: 160px;
  border: 2px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.photo-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.82rem;
  padding: 10px;
}

.photo-placeholder i {
  font-size: 2.2rem;
  margin-bottom: 6px;
  color: var(--accent-primary);
  display: block;
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-value {
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
  text-align: right;
}

.badge {
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.73rem;
  font-weight: 600;
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #1c2541;
  border: 1px solid var(--bg-card-border);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 20px;
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 10px;
}

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* Custom Leaflet Markers */
.user-location-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #0284c7;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.9);
}

.leaflet-container {
  background-color: #0b132b !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-control-zoom a {
  background-color: rgba(11, 19, 43, 0.88) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--bg-card-border) !important;
  border-radius: 12px !important;
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  margin-bottom: 6px !important;
}
