/* KORRIGIERTE VERSION - Bootstrap Accordion Kompatibilität */
/* Spezifischere Selektoren ohne globale Bootstrap-Überschreibungen */
/* LEAFLET-PROBLEMATISCHE CSS-FIXES ENTFERNT */

.referenzen-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.referenzen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin: 30px 0;
    align-items: stretch;
}

.referenz-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
    position: relative;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.referenz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.referenz-card:nth-child(1) { animation-delay: 0.1s; }
.referenz-card:nth-child(2) { animation-delay: 0.2s; }
.referenz-card:nth-child(3) { animation-delay: 0.3s; }
.referenz-card:nth-child(4) { animation-delay: 0.4s; }
.referenz-card:nth-child(5) { animation-delay: 0.5s; }
.referenz-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* BILD-BEREICH MIT BOOTSTRAP MODAL INTEGRATION */
.referenz-image,
.card-img-top.referenz-bild {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #8fa3b0 0%, #b8c5d1 100%);
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 16/9;
    height: auto;
}

.referenz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.card-img-top.referenz-bild {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.referenz-card:hover .referenz-image img,
.referenz-card:hover .card-img-top.referenz-bild {
    transform: scale(1.05);
}

.referenz-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    font-size: 48px;
    font-weight: 300;
    background: linear-gradient(135deg, #8fa3b0 0%, #b8c5d1 100%);
}

/* Zoom-Indikator für Bootstrap Modal */
.referenz-zoom-indicator {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 36px;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
    color: white;
}

.referenz-image:hover .referenz-zoom-indicator,
.card-img-top.referenz-bild:hover + .referenz-zoom-indicator,
.referenz-card:hover .referenz-zoom-indicator {
    opacity: 1;
}

/* BOOTSTRAP MODAL ANPASSUNGEN - NUR FÜR IMAGE MODAL */
/* WICHTIG: Spezifische Selektoren verwenden, nicht globale Modal-Überschreibungen */
.modal#imageModal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

.modal#imageModal .modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

.modal#imageModal .modal-header {
    border: none;
    padding: 0.5rem;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1060;
}

.modal#imageModal .btn-close {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    opacity: 1;
    filter: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.modal#imageModal .btn-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.modal#imageModal .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}

.modal#imageModal #modalImage {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    object-position: center center;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: modalImageZoom 0.3s ease;
}

.modal#imageModal .modal-footer {
    border: none;
    padding: 1rem;
    background: rgba(0,0,0,0.7);
    border-radius: 0 0 8px 8px;
}

.modal#imageModal #modalCaption {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

@keyframes modalImageZoom {
    from { 
        transform: scale(0.8); 
        opacity: 0; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* Modal Backdrop Anpassung - NUR für Image Modal */
.modal#imageModal + .modal-backdrop {
    background-color: rgba(0,0,0,0.9);
}

/* CONTENT-BEREICH */
.referenz-content,
.card-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.referenz-header {
    margin-bottom: 15px;
}

/* Jahr über Titel */
.referenz-jahr {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
    margin-bottom: 5px;
}

/* Titel in Body-Schrift bold */
.referenz-titel,
.card-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.card-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 15px;
}

.referenz-location {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #ab0033;
    font-size: 14px;
    font-weight: 600;
}

.referenz-location::before {
    content: "📍";
    margin-right: 6px;
}

/* Meta-Informationen */
.referenz-meta {
    margin-bottom: 15px;
}

.referenz-meta small {
    display: block;
    margin-bottom: 5px;
    color: #6c757d;
    font-size: 0.875rem;
}

.referenz-meta i {
    width: 16px;
    margin-right: 6px;
    color: #00304a;
}

/* Länderflagge Styling */
.country-flag {
    margin-left: 6px;
    font-size: 16px;
}

/* Unternehmenslogos über Bild (links oben) */
.referenz-unternehmen-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.referenz-unternehmen-overlay .unternehmen-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.referenz-kunde {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #00304a;
}

.referenz-kunde-label {
    font-weight: normal;
    color: #2c3e50;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.referenz-kunde-name {
    color: #34495e;
    font-size: 15px;
    font-weight: bold;
}

.referenz-beschreibung {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.referenz-leistungen {
    margin-bottom: 20px;
}

.referenz-leistungen h6 {
    font-weight: 600;
    color: #95a5a6;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.referenz-leistungen-label {
    font-weight: 600;
    color: #95a5a6;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.referenz-leistungen-text {
    color: #5a6c7d;
    font-size: 14px;
    line-height: 1.5;
}

/* TEXT-EXPANSION STYLING */
.expandable-text {
    display: inline;
}

.text-content {
    display: inline;
}

.expand-btn,
.text-expand-button {
    background: none;
    border: none;
    color: #868e96;
    font-size: inherit;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin: 0;
    margin-left: 4px;
    display: inline;
    vertical-align: baseline;
    font-family: inherit;
    line-height: inherit;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.expand-btn:hover,
.text-expand-button:hover {
    color: #495057;
    text-decoration: underline;
}

.expand-btn:active,
.text-expand-button:active {
    color: #343a40;
}

.expand-btn:focus,
.text-expand-button:focus {
    outline: 1px dotted #868e96;
    outline-offset: 1px;
}

/* FOOTER-BEREICH */
.referenz-footer {
    padding-top: 15px;
    margin-top: auto;
}

/* Geschäftsfeld in #00304a-Styling */
.referenz-geschaeftsfeld {
    background: #e6f0f5;
    color: #00304a;
    border: 1px solid #00304a;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: inline-block;
}

.referenz-unternehmen {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.unternehmen-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease;
}

.unternehmen-badge:hover {
    transform: scale(1.1);
}

.unternehmen-poe {
    background: #000000;
}

.unternehmen-edl {
    background: #0067B1;
}

.unternehmen-taf {
    background: #8A2716;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .referenzen-container {
        padding: 15px;
    }
    
    .referenzen-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .referenz-content,
    .card-body {
        padding: 20px;
    }
    
    .modal#imageModal .modal-dialog {
        max-width: 98vw;
        margin: 0.5rem auto;
    }
    
    .modal#imageModal #modalImage {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .referenz-content,
    .card-body {
        padding: 15px;
    }
    
    .referenz-titel,
    .card-title {
        font-size: 16px;
    }
    
    .referenzen-grid {
        gap: 15px;
    }
    
    .modal#imageModal #modalImage {
        max-height: 75vh;
    }
    
    .modal#imageModal #modalCaption {
        font-size: 1rem;
    }
}

/* FILTER-BEREICH */
.referenz-filter {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.filter-title::before {
    content: "🔍";
    margin-right: 8px;
}

/* EMPTY STATE */
.no-referenzen {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 2px dashed #bdc3c7;
    margin: 40px 0;
}

/* BOOTSTRAP CARD ANPASSUNGEN */
.card.referenz-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.card.referenz-card .card-body {
    padding: 25px;
}

/* ACCESSIBILITY IMPROVEMENTS */
@media (prefers-reduced-motion: reduce) {
    .referenz-card,
    .referenz-image img,
    .card-img-top.referenz-bild,
    .modal#imageModal #modalImage {
        animation: none;
        transition: none;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    .referenz-card {
        border: 2px solid #000;
    }
    
    .text-expand-button {
        color: #000;
        text-decoration: underline;
    }
    
    .modal#imageModal .btn-close {
        background: #fff;
        border: 2px solid #000;
    }
}

/* Weltkarten-Styling */
.element-subheader {
    margin-bottom: 20px;
}

/* DSGVO Overlay Styles für Referenz-Karte */
#referenz-map {
    position: relative;
    overflow: hidden;
    /* WICHTIG: Feste Höhe für Leaflet - ABER KEINE TILE-FIXES */
    height: 500px;
    width: 100%;
}

/* Overlay Animation */
.consent-overlay {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Button Hover-Effekte */
.consent-button-primary {
    background: #1976d2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.consent-button-primary:hover {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.consent-button-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.consent-button-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .consent-overlay {
        padding: 20px 15px;
    }
    
    .consent-overlay h3 {
        font-size: 20px;
    }
    
    .consent-overlay p {
        font-size: 14px;
    }
    
    .consent-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .consent-button-primary,
    .consent-button-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Leaflet Controls Styling */
.leaflet-control-zoom {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.leaflet-control-zoom a {
    background: white;
    color: #333;
    border: none;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
    font-weight: bold;
}

.leaflet-control-zoom a:hover {
    background: #f5f5f5;
    color: #1976d2;
}

/* Custom Marker Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.referenz-popup h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.referenz-popup p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.referenz-popup strong {
    color: #333;
}

/* Loading Animation für Tiles */
.leaflet-tile-container {
    transition: opacity 0.3s ease;
}

/* Overlay Background Pattern */
.consent-background-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { background-position: 0 0, 25px 25px; }
    100% { background-position: 50px 50px, 75px 75px; }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .consent-overlay {
        background: rgba(0, 0, 0, 0.85);
    }
    
    .consent-background-pattern {
        background-image: 
            radial-gradient(circle at 25% 25%, rgba(255,255,255,0.05) 2px, transparent 2px),
            radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 2px, transparent 2px);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .consent-button-primary {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .consent-button-secondary {
        background: transparent;
        color: #fff;
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .consent-overlay,
    .consent-button-primary,
    .consent-button-secondary,
    .leaflet-tile-container {
        animation: none;
        transition: none;
    }
    
    .consent-background-pattern {
        animation: none;
    }
}

.custom-marker {
    background: transparent;
    border: none;
}

/* === PROBLEMATISCHE LEAFLET-FIXES ENTFERNT === */
/* Diese CSS-Regeln haben das Tile-Rendering gestört:

ENTFERNT:
#referenz-map .leaflet-tile,
#referenz-map img.leaflet-image-layer,
.leaflet-container .leaflet-tile,
.leaflet-container img.leaflet-image-layer {
  max-width: none !important;
  max-height: none !important;
  width: 256px !important;
  height: 256px !important;
}

ENTFERNT:
#referenz-map {
  min-height: 420px;
}

ENTFERNT:
#referenz-map img {
  display: block;
  line-height: 0;
}

Diese Regeln haben die Tiles "löchrig" gemacht und Marker versteckt.
Leaflet funktioniert am besten mit seinen Standard-CSS-Regeln.
*/