/**
 * Main CSS - Global styles and CSS variables
 */

/* ══════════════════════════════════════════════════════
   CSS VARIABLES (linked to config.js)
   ══════════════════════════════════════════════════════ */
:root {
  /* Colors - These are set dynamically from config.js */
  --color-primary: #28B1EC;
  --color-primary-light: #28B1EC;
  --color-shape-fill-base: rgba(41, 255, 229, 0.9);
  --color-shape-fill: rgba(0, 122, 170, 0.5);
  --color-transform-frame: #FF8400;
  --color-handle-orange: #FF8400;
  --color-handle-white: #FFFFFF;
  --color-handle-border: #000000;
  --color-toolbar-bg: #1e293b;
  --color-toolbar-text: #e2e8f0;
  --color-body-bg: #0f172a;

  /* Dimensions */
  --handle-size-corner: 12px;
  --handle-size-edge: 10px;
  --handle-border-width: 2px;
  --stem-height: 33px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ══════════════════════════════════════════════════════
   RESET & BASE STYLES
   ══════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.map-tool-app {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-toolbar-text);
  background-color: var(--color-body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════
   APP CONTAINER
   ══════════════════════════════════════════════════════ */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ══════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-toolbar-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform var(--transition-normal);
  pointer-events: auto;
  max-width: 350px;
}

.toast.show {
  transform: translateX(0);
}

.toast.hide {
  transform: translateX(120%);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-icon svg {
  width: 100%;
  height: 100%;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: var(--color-toolbar-text);
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

/* Toast types */
.toast-success .toast-icon {
  color: #22c55e;
}

.toast-error .toast-icon {
  color: #ef4444;
}

.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-info .toast-icon {
  color: #3b82f6;
}

/* ══════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
}