/* PeakMarket Grid Widget V2 Styles */

.peakmarket-grid-widget-v2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Haupt Grid Container */
.peakmarket-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Kachel */
.peakmarket-grid-header-tile {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    height: 300px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.peakmarket-grid-header-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Unterkacheln Grid */
.peakmarket-grid-sub-tile:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.peakmarket-grid-sub-tile:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.peakmarket-grid-sub-tile:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

.peakmarket-grid-sub-tile:nth-child(5) {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

/* Responsive Grid für Unterkacheln */
@media (min-width: 768px) {
    .peakmarket-grid-container {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .peakmarket-grid-header-tile {
        grid-column: 1 / -1;
        grid-row: 1 / 2;
    }
}

/* Kachel Styling */
.peakmarket-grid-tile {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.peakmarket-grid-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Unterkacheln */
.peakmarket-grid-sub-tile {
    height: 200px;
}

/* Kachel Bild */
.peakmarket-tile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

.peakmarket-grid-tile:hover .peakmarket-tile-image img {
    transform: scale(1.05);
}

/* Kachel Content - Sichtbar auf allen Kacheln */
.peakmarket-tile-content {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 20px !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
    color: white !important;
    text-align: center !important;
    z-index: 10 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.peakmarket-tile-title {
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.peakmarket-tile-arrow {
    font-size: 20px !important;
    font-weight: 300 !important;
    opacity: 0.8 !important;
    color: white !important;
    visibility: visible !important;
    display: block !important;
}

/* Popup Overlay - Exakt wie Referenz */
.peakmarket-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

/* Popup Content - Exakt wie Referenz */
.peakmarket-popup-content {
    background: #fff;
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow: hidden;
    position: relative;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

/* Popup Navigation - Sichtbar und prominent oben */
.peakmarket-popup-nav {
    display: flex !important;
    background: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
    padding: 0;
    justify-content: flex-start;
    gap: 0;
    position: relative !important;
    height: 60px !important;
    align-items: center;
    z-index: 1000001 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

.peakmarket-popup-nav::-webkit-scrollbar {
    display: none;
}

.peakmarket-popup-nav-item {
    background: none;
    border: none;
    padding: 0 30px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: none;
    position: relative;
    text-transform: none;
    letter-spacing: normal;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid #e0e0e0;
    z-index: 1000002 !important;
}

.peakmarket-popup-nav-item:hover {
    color: #2c5a87;
    background: #f8f9fa;
}

.peakmarket-popup-nav-item.active {
    color: #2c5a87;
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 3px solid #2c5a87;
}

/* Close Button - Sichtbar oben rechts */
.peakmarket-popup-close {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 1000003 !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.peakmarket-popup-close:hover {
    background: #f0f0f0;
}

/* Popup Body - Unter dem Menü */
.peakmarket-popup-body {
    padding: 40px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    margin-top: 60px !important; /* Platz für das Menü */
    height: calc(100% - 60px) !important; /* Höhe minus Menü */
}

/* Popup Tile Content Container */
.peakmarket-popup-tile-content {
    display: none;
    width: 100%;
    height: 100%;
    max-width: 1400px;
}

.peakmarket-popup-tile-content.active {
    display: block;
}

/* Popup Grid - Exakt wie Referenz */
.peakmarket-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 30px;
    width: 100%;
    height: 100%;
    max-height: 700px;
}

/* Popup Header Tile - Exakt wie Referenz */
.peakmarket-popup-header-tile {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    height: 350px;
}

/* Popup Sub Tiles - Exakt wie Referenz */
.peakmarket-popup-sub-tile:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.peakmarket-popup-sub-tile:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.peakmarket-popup-sub-tile:nth-child(4) {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

.peakmarket-popup-sub-tile:nth-child(5) {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

/* Popup Tiles - Exakt wie Referenz */
.peakmarket-popup-tile {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.peakmarket-popup-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.peakmarket-popup-tile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.peakmarket-popup-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.peakmarket-popup-tile:hover .peakmarket-popup-tile-image img {
    transform: scale(1.05);
}

/* Popup Tile Content - Texte auf Popup-Kacheln sichtbar */
.peakmarket-popup-tile .peakmarket-popup-tile-content {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 30px !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)) !important;
    color: white !important;
    text-align: left !important;
    z-index: 10 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.peakmarket-popup-tile .peakmarket-popup-tile-title {
    margin: 0 0 15px 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    line-height: 1.2 !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.peakmarket-popup-tile .peakmarket-popup-tile-description {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    opacity: 1 !important;
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7) !important;
    font-weight: 400 !important;
    display: block !important;
    visibility: visible !important;
}

/* Placeholder für fehlende Bilder */
.placeholder-image {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design - Exakt wie Referenz */
@media (max-width: 767px) {
    .peakmarket-grid-container {
        padding: 10px;
        gap: 15px;
    }
    
    .peakmarket-grid-header-tile {
        height: 200px;
    }
    
    .peakmarket-grid-sub-tile {
        height: 150px;
    }
    
    .peakmarket-tile-title {
        font-size: 16px;
    }
    
    /* Popup Mobile Optimierung */
    .peakmarket-popup-overlay {
        padding: 0;
    }
    
    .peakmarket-popup-content {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
    
    .peakmarket-popup-nav {
        padding: 0;
        gap: 0;
        height: 50px;
    }
    
    .peakmarket-popup-nav-item {
        padding: 0 20px;
        font-size: 14px;
    }
    
    .peakmarket-popup-body {
        padding: 20px;
        margin-top: 50px !important;
        height: calc(100% - 50px) !important;
    }
    
    /* Mobile Grid Layout */
    .peakmarket-popup-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
        gap: 20px;
        max-height: none;
    }
    
    .peakmarket-popup-header-tile {
        height: 250px;
    }
    
    .peakmarket-popup-tile {
        height: 220px;
    }
    
    .peakmarket-popup-tile .peakmarket-popup-tile-content {
        padding: 20px;
    }
    
    .peakmarket-popup-tile .peakmarket-popup-tile-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .peakmarket-popup-tile .peakmarket-popup-tile-description {
        font-size: 14px;
    }
}

/* Smooth Transitions */
.peakmarket-grid-tile,
.peakmarket-popup-tile,
.peakmarket-popup-nav-item {
    transition: all 0.3s ease;
}

/* Focus States für Accessibility */
.peakmarket-grid-tile:focus,
.peakmarket-popup-nav-item:focus {
    outline: 2px solid #2c5a87;
    outline-offset: 2px;
}

/* Loading States */
.peakmarket-grid-tile.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Animation für Popup */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.peakmarket-popup-content {
    animation: popupFadeIn 0.3s ease;
}

/* Wichtige Debug-Regeln */
.peakmarket-popup-overlay.show {
    display: flex !important;
}

.peakmarket-popup-overlay.hide {
    display: none !important;
}

/* Z-Index Sicherheit */
.peakmarket-popup-overlay {
    z-index: 999999 !important;
}

.peakmarket-popup-content {
    z-index: 1000000 !important;
}

/* Cursor für Klicks */
.peakmarket-grid-tile {
    cursor: pointer !important;
}

.peakmarket-popup-nav-item {
    cursor: pointer !important;
}

.peakmarket-popup-close {
    cursor: pointer !important;
}

/* Menü-Sichtbarkeit sicherstellen */
.peakmarket-popup-nav {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    position: relative !important;
    z-index: 1000001 !important;
}

.peakmarket-popup-nav-item {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    z-index: 1000002 !important;
}

/* Text-Sichtbarkeit auf Kacheln sicherstellen */
.peakmarket-tile-content {
    pointer-events: none !important; /* Verhindert Klick-Konflikte */
}

.peakmarket-tile-title,
.peakmarket-tile-arrow {
    pointer-events: none !important; /* Verhindert Klick-Konflikte */
}

/* Hover-Effekte für bessere Sichtbarkeit */
.peakmarket-grid-tile:hover .peakmarket-tile-content {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)) !important;
}

.peakmarket-grid-tile:hover .peakmarket-tile-title {
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9) !important;
}

/* Popup-Tile Text-Sichtbarkeit sicherstellen */
.peakmarket-popup-tile .peakmarket-popup-tile-content {
    pointer-events: none !important; /* Verhindert Klick-Konflikte */
}

.peakmarket-popup-tile .peakmarket-popup-tile-title,
.peakmarket-popup-tile .peakmarket-popup-tile-description {
    pointer-events: none !important; /* Verhindert Klick-Konflikte */
} 