/* Alpenhof Grid Widget Styles */

.alpenhof-grid-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Kategorie Navigation */
.alpenhof-category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    background: #f5f5f5;
    border: 2px solid #ddd;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-btn:hover,
.category-btn.active {
    background: #2c5a87;
    color: white;
    border-color: #2c5a87;
}

/* Grid Container */
.alpenhof-grid-container {
    position: relative;
    min-height: 600px;
}

.alpenhof-grid {
    display: none;
    grid-template-columns: repeat(var(--grid-columns, 4), 1fr);
    gap: var(--grid-gap, 15px);
    margin-bottom: 30px;
}

.alpenhof-grid.active {
    display: grid;
}

/* Spezielle Grid-Layouts basierend auf der Referenzseite - 5 Kacheln */
.alpenhof-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 300px 200px 200px;
    gap: var(--grid-gap, 15px);
}

.alpenhof-grid.active {
    display: grid;
}

/* Layout für 5 Kacheln wie auf der Referenzseite */
.alpenhof-grid-tile.tile-large {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 300px;
}

.alpenhof-grid-tile.tile-medium:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.alpenhof-grid-tile.tile-medium:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.alpenhof-grid-tile.tile-medium:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
}

.alpenhof-grid-tile.tile-medium:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
}

/* Grid Tiles */
.alpenhof-grid-tile {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: flex-end;
}

.alpenhof-grid-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Fallback für Tiles ohne Hintergrundbild - mit !important um sicherzustellen dass sie angezeigt werden */
.alpenhof-grid-tile:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.alpenhof-grid-tile:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.alpenhof-grid-tile:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.alpenhof-grid-tile:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
}

.alpenhof-grid-tile:nth-child(5) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
}

/* Wenn Hintergrundbild gesetzt ist, überschreibe die Fallbacks */
.alpenhof-grid-tile[style*="background-image"] {
    background: none !important;
}

/* Tile Overlay */
.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.3) 50%,
        rgba(0,0,0,0.7) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 30px;
}

.tile-content h3 {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tile-content p {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Popup Styles */
.alpenhof-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.alpenhof-popup-overlay.active {
    display: flex;
}

.alpenhof-popup-content {
    background: white;
    border-radius: 20px;
    max-width: 1000px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: white;
    transform: scale(1.1);
}

/* Popup Navigation */
.popup-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
    max-height: 60px;
    overflow: hidden;
    flex-shrink: 0;
}

.popup-nav-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.popup-nav-tab {
    background: transparent;
    border: none;
    padding: 15px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.popup-nav-tab:hover {
    background: #e9ecef;
    color: #2c5a87;
}

.popup-nav-tab.active {
    color: #2c5a87;
    border-bottom-color: #2c5a87;
    background: white;
}

/* Popup Body */
.popup-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
    display: flex;
    flex-direction: column;
}

.popup-content-area {
    display: none;
    flex-direction: column;
    height: 100%;
}

.popup-content-area.active {
    display: flex;
}

.popup-main-content {
    flex: 1;
    overflow-y: auto;
}

.popup-hero-image {
    position: relative;
    height: 400px;
    overflow: hidden;
    flex-shrink: 0;
}

.popup-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px;
    color: white;
}

.popup-hero-overlay h2 {
    font-size: 36px;
    font-weight: bold;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.popup-hero-overlay p {
    font-size: 18px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

.popup-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 30px;
}

.popup-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.popup-additional-content {
    padding: 30px;
    line-height: 1.6;
}

.popup-additional-content h3 {
    color: #2c5a87;
    margin-bottom: 15px;
}

/* CTA Button Bereich */
.popup-cta-section {
    background: #4a4a4a;
    padding: 30px;
    margin-top: auto;
    border-radius: 0 0 20px 20px;
    flex-shrink: 0;
}

.popup-cta-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.popup-cta-button {
    background: #5cb85c;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    min-width: 250px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.popup-cta-button:hover {
    background: #4cae4c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(92, 184, 92, 0.3);
    color: white;
    text-decoration: none;
}

.popup-cta-button:active {
    transform: translateY(0);
}

.popup-cta-secondary {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: right;
    flex: 1;
}

/* Responsive CTA */
@media (max-width: 768px) {
    .popup-cta-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .popup-cta-button {
        min-width: auto;
        width: 100%;
        max-width: 300px;
        padding: 12px 25px;
        font-size: 15px;
    }
    
    .popup-cta-secondary {
        text-align: center;
        font-size: 16px;
    }
    
    .popup-cta-section {
        padding: 20px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .alpenhof-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, 200px);
        gap: 15px;
    }
    
    .alpenhof-grid-tile.tile-large,
    .alpenhof-grid-tile.tile-medium {
        grid-column: 1;
        grid-row: auto;
    }
    
    .tile-overlay {
        padding: 20px;
    }
    
    .tile-content h3 {
        font-size: 20px;
    }
    
    .tile-content p {
        font-size: 14px;
    }
    
    .alpenhof-popup-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .popup-hero-overlay {
        padding: 20px;
    }
    
    .popup-hero-overlay h2 {
        font-size: 24px;
    }
    
    .popup-hero-overlay p {
        font-size: 16px;
    }
    
    .popup-gallery {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .popup-additional-content {
        padding: 20px;
    }
    
    .popup-nav-tabs {
        flex-wrap: wrap;
    }
    
    .popup-nav-tab {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .category-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .alpenhof-grid-widget {
        padding: 15px;
    }
    
    .popup-hero-image {
        height: 250px;
    }
    
    .popup-hero-overlay h2 {
        font-size: 20px;
    }
    
    .tile-content h3 {
        font-size: 18px;
    }
}

/* Animation für Kategorie-Wechsel */
.alpenhof-grid {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alpenhof-grid.active {
    opacity: 1;
}

/* Loading Animation */
.alpenhof-grid-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f0f0f0;
    z-index: -1;
}

/* Hover Effekte für bessere UX */
.alpenhof-grid-tile:active {
    transform: translateY(-2px);
}

.popup-nav-tab:active {
    transform: translateY(1px);
}

.category-btn:active {
    transform: translateY(1px);
}
