/* =================================================================== */
/* SMARTMAPS DEMO - GLOBALES STYLESHEET                          */
/* =================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(../fonts/MaterialIcons-Regular.woff2) format('woff2');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* 2. CSS Custom Properties für eine einheitliche Farbpalette */
:root {
    --brand-primary: #18345c;
    --brand-secondary: #3498db;
    --brand-accent: #f6b80c;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-light: #6b7280;
    --surface-bg: #f4f7fa;
    --surface-panel: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
}

/* 3. Globale Body- und Typografie-Stile */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--surface-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* 4. Konsistente Ladeanimation */
.loader {
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid var(--brand-secondary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* 5. Konsistente Panel-Stile */
.control-panel, .dashboard, .info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--surface-panel);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 31, 82, 0.12);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    z-index: 10;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden; /* Dies ist weiterhin nützlich für andere seltene Fälle */
    box-sizing: border-box;
}

h1 {
    font-size: 1.75em;
    margin: 0 0 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-primary);
}

/* 6. Tooltip-Verbesserung (KORRIGIERT) */
.info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #9ca3af;
}
.info-icon .tooltip {
    visibility: hidden;
    width: 260px;
    background-color: #1f2937;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.5;
    font-weight: 400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    
    /* NEUE POSITIONIERUNG: Richtet das Tooltip rechtsbündig am Icon aus */
    bottom: 130%;
    right: 0;
    left: auto;
    transform: translateX(0); /* Entfernt die Zentrierung */
}
.info-icon .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    
    /* NEUE POSITIONIERUNG: Richtet den Pfeil rechts aus */
    right: 10px; 
    left: auto;
    margin-left: 0;

    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}
.info-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}
.info-icon .tooltip strong {
    color: var(--brand-secondary);
}

/* 7. Mobile Anpassungen für Panels */
@media (max-width: 480px) {
    .control-panel, .dashboard, .info-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 20px);
    }
}
