/* Carbon Design System visual theme for geo-gestion (colores actuales) */

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../static/IBM%20Plex%20Sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gg-primary: #3b82f6;
  --gg-primary-hover: #2563eb;
  --gg-background: #f8fafc;
  --gg-layer: #ffffff;
  --gg-layer-header: #f9fafb;
  --gg-border: #e5e7eb;
  --gg-border-strong: #d1d5db;
  --gg-text-primary: #1f2937;
  --gg-text-secondary: #4b5563;
  --gg-text-helper: #6b7280;
  --gg-focus: #3b82f6;
  --gg-danger: #d73027;
  --gg-warning: #f59e0b;
  --gg-success: #10b981;
}

/* Base */
body,
#app {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  color: var(--gg-text-primary);
  background: var(--gg-background);
}

/* Sidebars */
#app .left-sidebar,
#app .right-sidebar {
  background: var(--gg-layer);
  border-color: var(--gg-border);
  box-shadow: none;
}

#app .right-sidebar {
  border-left-color: var(--gg-border);
}

#app .sidebar-header {
  background: var(--gg-layer-header);
  border-bottom: 1px solid var(--gg-border);
}

#app .sidebar-body {
  background: var(--gg-layer);
}

/* Map */
#app #map-container {
  background: var(--gg-background);
}

/* Buttons / toggles */
#app .sidebar-toggle,
#app .sidebar-show-toggle {
  background: var(--gg-primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.285;
  padding: 10px 12px;
  transition: background-color 0.15s ease;
}

#app .sidebar-toggle:hover,
#app .sidebar-show-toggle:hover {
  background: var(--gg-primary-hover);
  color: #ffffff;
  transform: none;
}

#app .sidebar-show-toggle:hover {
  transform: translateY(-50%);
}

/* Labels */
#app label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gg-text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.32px;
}

/* Selects */
#app select {
  width: 100%;
  min-height: 40px;
  padding: 11px 40px 11px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.285;
  color: var(--gg-text-primary);
  background-color: #e5e5e5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%231f2937' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: none;
  border-bottom: 1px solid #8d8d8d;
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#app select:focus {
  outline: none;
  border-bottom: 2px solid var(--gg-primary);
  box-shadow: none;
}

/* Checkboxes */
#app input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  background: var(--gg-layer);
  border: 1px solid var(--gg-text-secondary);
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

#app input[type="checkbox"] + label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  line-height: 16px;
  font-weight: 400;
}

#app input[type="checkbox"]:checked {
  background: var(--gg-primary);
  border-color: var(--gg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M5 8.5l2.5 2.5 4-5' stroke='%23ffffff' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Footer */
#app .app-footer {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--gg-border);
  color: var(--gg-text-secondary);
  font-size: 12px;
}

/* Map popups */
.mapboxgl-popup {
  font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}

.mapboxgl-popup-content {
  background: var(--gg-layer);
  border: 1px solid var(--gg-border);
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  padding: 0;
}

.mapboxgl-popup-tip {
  border-top-color: var(--gg-border);
  border-bottom-color: var(--gg-border);
}

/* Carbon helper classes (colores actuales) */
.cds--tile {
  background: var(--gg-layer);
  border: 1px solid var(--gg-border);
  padding: 16px;
}

.cds--tag {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  height: 24px;
  background: var(--gg-layer-header);
  border: 1px solid var(--gg-border);
  color: var(--gg-text-primary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.333;
}

.cds--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  background: var(--gg-primary);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.cds--btn:hover {
  background: var(--gg-primary-hover);
}

.cds--btn--ghost {
  background: transparent;
  color: var(--gg-primary);
  border-color: transparent;
}

.cds--btn--ghost:hover {
  background: var(--gg-layer-header);
  color: var(--gg-primary-hover);
}

/* Flatten Tailwind radius/shadow inside the app for Carbon look */
#app .rounded,
#app .rounded-sm,
#app .rounded-md,
#app .rounded-lg,
#app .rounded-xl,
#app .rounded-2xl,
#app .rounded-3xl {
  border-radius: 0;
}

#app .shadow,
#app .shadow-sm,
#app .shadow-lg,
#app .shadow-xl,
#app .shadow-2xl {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#app select[multiple] {
  min-height: 80px;
  padding-right: 12px;
  background-image: none;
}

#app select:hover,
#app select:focus:hover {
  box-shadow: none;
}

/* Sidebar accordion sections */
#app .gg-section,
#app .gg-subsection {
  border-bottom: 1px solid var(--gg-border);
}

#app .gg-section summary,
#app .gg-subsection summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gg-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#app .gg-section summary::after,
#app .gg-subsection summary::after {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.15s ease;
}

#app .gg-section[open] > summary::after,
#app .gg-subsection[open] > summary::after {
  transform: rotate(180deg);
}

#app .gg-section summary::-webkit-details-marker,
#app .gg-subsection summary::-webkit-details-marker {
  display: none;
}

#app .gg-section-content {
  padding: 0 12px 12px;
}

#app .gg-subsection {
  margin-top: 8px;
  background: var(--gg-layer-header);
  border: 1px solid var(--gg-border);
}

#app .gg-subsection > summary {
  font-size: 11px;
}

#app .gg-subsection > .gg-section-content {
  padding: 8px 12px;
}

#app .gg-section-title {
  padding: 11px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gg-text-primary);
}

#app .gg-subtitle {
  padding: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gg-text-primary);
}

/* Search input */
#app .gg-search {
  position: relative;
}

#app .gg-search input[type="search"] {
  width: 100%;
  min-height: 40px;
  padding: 11px 12px 11px 40px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.285;
  color: var(--gg-text-primary);
  background-color: #e5e5e5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85 1.415-1.415-3.85-3.85zm-5.244 0a5 5 0 1 1 0-7.07 5 5 0 0 1 0 7.07z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border: none;
  border-bottom: 1px solid #8d8d8d;
  border-radius: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#app .gg-search input[type="search"]:focus {
  outline: none;
  border-bottom: 2px solid var(--gg-primary);
}

#app .gg-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* Layer order list */
#app .gg-layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#app .gg-layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--gg-layer);
  border: 1px solid var(--gg-border);
  border-left: 3px solid var(--gg-primary);
  cursor: grab;
}

#app .gg-layer-item.gg-dragging {
  opacity: 0.6;
}

#app .gg-layer-label {
  font-size: 12px;
  color: var(--gg-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .gg-layer-controls {
  display: flex;
  gap: 4px;
}

#app .gg-layer-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  color: var(--gg-text-primary);
  background: var(--gg-layer-header);
  border: 1px solid var(--gg-border);
  border-radius: 0;
  cursor: pointer;
}

#app .gg-layer-btn:disabled {
  color: var(--gg-border-strong);
  cursor: not-allowed;
}

#app .gg-layer-btn:hover:not(:disabled) {
  background: var(--gg-border);
}

/* Opacity control */
#app .gg-opacity-control {
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

#app .gg-opacity-label {
  font-size: 11px;
  color: var(--gg-text-secondary);
}

#app .gg-opacity-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: var(--gg-border-strong);
  outline: none;
}

#app .gg-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--gg-primary);
  cursor: pointer;
}

#app .gg-opacity-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--gg-primary);
  cursor: pointer;
  border: none;
}

#app .gg-opacity-value {
  font-size: 11px;
  color: var(--gg-text-helper);
  min-width: 32px;
  text-align: right;
}

/* Base layer radio options */
#app .gg-base-layer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#app .gg-base-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

#app .gg-base-radio {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--gg-text-secondary);
  border-radius: 50%;
  background: var(--gg-layer);
  cursor: pointer;
}

#app .gg-base-radio:checked {
  border: 5px solid var(--gg-primary);
  background: var(--gg-layer);
}

#app .gg-base-label {
  font-size: 13px;
  color: var(--gg-text-primary);
  cursor: pointer;
}

/* Coloring mode radio options */
#app .gg-coloring-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#app .gg-coloring-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

#app .gg-coloring-radio {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--gg-text-secondary);
  border-radius: 50%;
  background: var(--gg-layer);
  cursor: pointer;
}

#app .gg-coloring-radio:checked {
  border: 5px solid var(--gg-primary);
  background: var(--gg-layer);
}

#app .gg-coloring-label {
  font-size: 13px;
  color: var(--gg-text-primary);
  cursor: pointer;
}
