/* Frontend CSS für Interactive Map Plugin */

/* Container und Layout */
.interactive-map-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Hauptkarte */
.interactive-map {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.interactive-map:active {
    cursor: grabbing;
}

.interactive-map:hover {
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

/* Marker Styling */
.map-marker {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate(-50%, -50%);
    z-index: 10;
}

.map-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    z-index: 15;
}

.map-marker:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.map-marker.active {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.8), 0 6px 20px rgba(0,0,0,0.4);
    z-index: 20;
}

/* Marker-Nummern */
.marker-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    line-height: 1;
}

/* Tooltips - Modernes Design */
.marker-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 4px 20px rgba(0,0,0,0.1);
    min-width: 320px;
    max-width: 450px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    margin-bottom: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 12px solid transparent;
    border-top-color: #ffffff;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.map-marker:hover .marker-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.tooltip-image-container {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    border-radius: 16px 16px 0 0;
}

.tooltip-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tooltip-image-container:hover .tooltip-image {
    transform: scale(1.05);
}

.tooltip-header {
    padding: 20px 20px 8px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.tooltip-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -0.5px;
}

.tooltip-date {
    padding: 0 20px 20px 20px;
    color: #7f8c8d;
    font-size: 15px;
    text-align: center;
    background: #ffffff;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

.tooltip-more-info-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: none !important;
    padding: 16px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
    overflow: hidden !important;
}

.tooltip-more-info-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.tooltip-more-info-btn:hover::before {
    left: 100%;
}

.tooltip-more-info-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3) !important;
}

.tooltip-more-info-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3) !important;
}

.tooltip-more-info-btn:focus {
    outline: 3px solid rgba(231, 76, 60, 0.3) !important;
    outline-offset: 2px !important;
}

.tooltip-extra-content {
    background: #fafafa;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zusätzliche Styles für bessere Button-Darstellung */
.marker-tooltip button.tooltip-more-info-btn,
.marker-tooltip .btn.tooltip-more-info-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    border: none !important;
    padding: 16px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 50px !important;
    border-color: #e74c3c !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Bootstrap Button Override */
.btn-danger.tooltip-more-info-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    border-color: #e74c3c !important;
    color: white !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
}

.btn-danger.tooltip-more-info-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    border-color: #c0392b !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3) !important;
}

.marker-tooltip button.tooltip-more-info-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3) !important;
}

.marker-tooltip button.tooltip-more-info-btn:active {
    background: linear-gradient(135deg, #a93226 0%, #922b21 100%) !important;
    transform: translateY(0) !important;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3) !important;
}

.tooltip-description {
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 400;
}

.tooltip-additional-info,
.tooltip-contact {
    margin-bottom: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tooltip-additional-info h5,
.tooltip-contact h5 {
    color: #e74c3c;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.tooltip-additional-info div,
.tooltip-contact div {
    color: #34495e;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

/* Zoom-Controls */
.zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 30;
}

.zoom-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.zoom-controls button:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.zoom-controls button:active {
    transform: translateY(0);
}

/* Legenden */
.marker-legend,
.route-legend {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.marker-legend h4,
.route-legend h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.marker-legend h4::before {
    content: '📍';
    font-size: 16px;
}

.route-legend h4::before {
    content: '🛣️';
    font-size: 16px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.legend-item:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-item.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.legend-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    position: relative;
    flex-shrink: 0;
}

.legend-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.legend-line {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-title {
    font-size: 14px;
    font-weight: 500;
    color: inherit;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Routen-SVG */
.routes-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.route-group.active line {
    stroke-width: 6px !important;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3)) !important;
    animation: routePulse 2s ease-in-out infinite;
}

.route-line {
    transition: stroke-width 0.3s ease;
}

.route-line:hover {
    stroke-width: 6px;
}

.route-line-border {
    transition: stroke-width 0.3s ease;
}

.route-line-border:hover {
    stroke-width: 8px;
}

@keyframes routePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Fehlermeldungen */
.no-map-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    color: #6c757d;
    font-size: 16px;
    line-height: 1.5;
}

.no-map-message p {
    margin: 0;
}

/* Loading-Zustand */
.interactive-map.loading {
    position: relative;
}

.interactive-map.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.interactive-map.loading::before {
    content: 'Lade Karte...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 51;
    color: #2c3e50;
    font-weight: 500;
}

/* Accessibility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Fokus-Indikatoren für bessere Accessibility */
.map-marker:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.legend-item:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.zoom-controls button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .map-marker {
        border-width: 4px;
    }
    
    .marker-tooltip {
        border-width: 2px;
        border-color: #000;
    }
    
    .legend-item {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .map-marker,
    .marker-tooltip,
    .legend-item,
    .zoom-controls button {
        transition: none;
    }
    
    .route-group.active line {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .interactive-map-container {
        color: #e9ecef;
    }
    
    .marker-tooltip {
        background: #2c3e50;
        border-color: #495057;
        color: #e9ecef;
    }
    
    .marker-tooltip::after {
        border-top-color: #2c3e50;
    }
    
    .tooltip-header h4 {
        color: #f8f9fa;
    }
    
    .tooltip-content {
        color: #adb5bd;
    }
    
    .zoom-controls button {
        background: rgba(44, 62, 80, 0.95);
        color: #f8f9fa;
    }
    
    .zoom-controls button:hover {
        background: #2c3e50;
    }
    
    .marker-legend,
    .route-legend {
        background: #2c3e50;
        border-color: #495057;
    }
    
    .legend-item {
        background: #495057;
        border-color: #6c757d;
        color: #e9ecef;
    }
    
    .legend-item:hover {
        background: #6c757d;
        border-color: #0073aa;
    }
    
    .no-map-message {
        background: #2c3e50;
        border-color: #495057;
        color: #adb5bd;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .interactive-map-container {
        padding: 15px 0;
    }
    
    .interactive-map {
        border-radius: 8px;
    }
    
    .map-marker {
        width: 28px;
        height: 28px;
    }
    
    .marker-number {
        font-size: 11px;
    }
    
    .marker-tooltip {
        min-width: 180px;
        max-width: 280px;
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .tooltip-header h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .tooltip-content {
        font-size: 13px;
    }
    
    .zoom-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .zoom-controls button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .marker-legend,
    .route-legend {
        margin-top: 20px;
        padding: 15px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-item {
        min-width: auto;
        width: 100%;
    }
    
    .legend-marker {
        width: 20px;
        height: 20px;
    }
    
    .legend-line {
        width: 30px;
        height: 3px;
    }
    
    .legend-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .interactive-map-container {
        padding: 10px 0;
    }
    
    .map-marker {
        width: 24px;
        height: 24px;
    }
    
    .marker-number {
        font-size: 10px;
    }
    
    .marker-tooltip {
        min-width: 150px;
        max-width: 250px;
        padding: 10px;
        font-size: 12px;
    }
    
    .tooltip-header h4 {
        font-size: 14px;
    }
    
    .tooltip-content {
        font-size: 12px;
    }
    
    .zoom-controls button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .marker-legend h4,
    .route-legend h4 {
        font-size: 16px;
    }
    
    .legend-item {
        padding: 6px 10px;
    }
    
    .legend-marker {
        width: 18px;
        height: 18px;
    }
    
    .legend-line {
        width: 24px;
        height: 2px;
    }
    
    .legend-title {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .interactive-map-container {
        padding: 0;
    }
    
    .interactive-map {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .zoom-controls {
        display: none;
    }
    
    .marker-tooltip {
        opacity: 1;
        visibility: visible;
        position: static;
        transform: none;
        margin: 10px 0;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .marker-legend,
    .route-legend {
        break-inside: avoid;
        margin-top: 15px;
        padding: 10px;
        border: 1px solid #000;
        background: #fff;
    }
    
    .legend-items {
        flex-direction: column;
    }
    
    .legend-item {
        break-inside: avoid;
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Animation für Marker-Hover */
@keyframes markerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.map-marker:hover {
    animation: markerPulse 0.6s ease-in-out;
}

/* Smooth Scrolling für bessere UX */
.interactive-map-container {
    scroll-behavior: smooth;
}

/* Verbesserte Touch-Targets für mobile Geräte */
@media (max-width: 768px) {
    .map-marker {
        min-width: 44px;
        min-height: 44px;
    }
    
    .zoom-controls button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .legend-item {
        min-height: 44px;
    }
}
