/**
 * State-of-the-Art Favoriten-System
 * Modern Heart Button with Animation
 */

/* CTA Buttons Row (Favoriten + Nachricht nebeneinander) */
.cta-buttons-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

/* Favoriten-Button (Herz) */
.btn-favorite {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #dbc16d;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-favorite:hover {
    transform: scale(1.05);
    border-color: #c5a952;
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.3);
}

.btn-favorite:active {
    transform: scale(0.95);
}

/* Herz-Icon Container */
.btn-favorite .heart-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: block;
}

/* SVG Icons */
.btn-favorite svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

/* Outline (Standard) */
.btn-favorite .heart-outline {
    opacity: 1;
    transform: scale(1);
    color: #dbc16d;
}

.btn-favorite .heart-filled {
    opacity: 0;
    transform: scale(0.5);
    color: #dbc16d;
}

/* IS FAVORITE STATE */
.btn-favorite.is-favorite {
    background: linear-gradient(135deg, #dbc16d 0%, #c5a952 100%);
    border-color: #dbc16d;
}

.btn-favorite.is-favorite .heart-outline {
    opacity: 0;
    transform: scale(1.2);
}

.btn-favorite.is-favorite .heart-filled {
    opacity: 1;
    transform: scale(1);
    color: #fff;
}

/* ANIMATION: "Pop" Effekt beim Klick */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.btn-favorite.animating .heart-icon {
    animation: heartBeat 0.6s ease;
}

/* Hover-Effekt */
.btn-favorite:hover .heart-outline {
    color: #c5a952;
}

.btn-favorite.is-favorite:hover .heart-filled {
    color: #fff;
    filter: brightness(1.1);
}

/* Nachricht-Button (passt sich an) */
.cta-buttons-row .btn-primary-compact {
    flex: 1;
    min-width: 0; /* Ermöglicht Flexbox-Shrinking */
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .cta-buttons-row {
        gap: 10px;
    }
    
    .btn-favorite {
        width: 50px;
        height: 50px;
    }
    
    .btn-favorite .heart-icon {
        width: 20px;
        height: 20px;
    }
}

/* Loading State */
.btn-favorite.loading {
    pointer-events: none;
    opacity: 0.6;
}

.btn-favorite.loading .heart-icon {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tooltip (optional) */
.btn-favorite::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(1, 34, 28, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 100;
}

.btn-favorite:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .btn-favorite {
        background: #01221c;
        border-color: #dbc16d;
    }
    
    .btn-favorite:not(.is-favorite) .heart-outline {
        color: #dbc16d;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/*   GRID-VIEW FAVORITEN-BUTTON (NOBLE ATLAS STYLE)            */
/* ═══════════════════════════════════════════════════════════ */

/* Grid-Favoriten-Button - KOMPAKT & ELEGANT */
.btn-favorite-grid {
    width: auto;
    min-width: 44px; /* Kompakter */
    height: auto;
    padding: 10px 12px; /* Etwas kleiner als Kontakt */
    border-radius: 8px;
    border: 2px solid rgba(219, 193, 109, 0.4);
    background: linear-gradient(135deg, rgba(1, 34, 28, 0.7), rgba(1, 34, 28, 0.5));
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Glanz-Effekt */
.btn-favorite-grid::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(219, 193, 109, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.btn-favorite-grid:hover::before {
    left: 100%;
}

.btn-favorite-grid:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(219, 193, 109, 0.5);
    border-color: #dbc16d;
    background: linear-gradient(135deg, rgba(1, 34, 28, 0.9), rgba(1, 34, 28, 0.7));
}

.btn-favorite-grid:active {
    transform: translateY(-1px);
}

.btn-favorite-grid .heart-icon {
    width: 18px; /* Kompakter */
    height: 18px;
    position: relative;
    z-index: 1;
}

/* Herz-Outline (Standard) - Gold */
.btn-favorite-grid .heart-outline {
    color: #dbc16d;
    filter: drop-shadow(0 0 3px rgba(219, 193, 109, 0.5));
}

.btn-favorite-grid .heart-filled {
    color: #dbc16d;
}

/* Grid: IS FAVORITE STATE - Gold-Gradient mit weißem Herz */
.btn-favorite-grid.is-favorite {
    background: linear-gradient(135deg, #dbc16d 0%, #c5a952 100%);
    border-color: #dbc16d;
    box-shadow: 0 4px 15px rgba(219, 193, 109, 0.5);
}

.btn-favorite-grid.is-favorite .heart-outline {
    opacity: 0;
    transform: scale(0.5);
}

.btn-favorite-grid.is-favorite .heart-filled {
    opacity: 1;
    transform: scale(1);
    color: #01221c; /* Dunkles Herz auf Gold */
}

.btn-favorite-grid.is-favorite:hover {
    box-shadow: 0 6px 25px rgba(219, 193, 109, 0.6);
    transform: translateY(-3px) scale(1.02);
}

/* Grid: Animation - stärkerer Effekt */
.btn-favorite-grid.animating .heart-icon {
    animation: heartBeatStrong 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes heartBeatStrong {
    0% { transform: scale(1); }
    15% { transform: scale(0.8); }
    30% { transform: scale(1.4); }
    45% { transform: scale(1.2); }
    60% { transform: scale(1.35); }
    75% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* Card CTA Buttons Layout - KOMPAKT */
.card-cta {
    display: flex;
    gap: 6px; /* Kleinerer Gap */
    align-items: center;
    padding: 0 12px 12px 12px; /* Reduziertes Padding */
}

.card-cta .btn-contact-grid {
    flex: 1;
    min-width: 0; /* Erlaubt Shrinking */
    padding: 8px 10px !important; /* Noch kompakter */
    font-size: 0.8rem !important; /* Kleinere Schrift */
}

.card-cta .btn-favorite-grid {
    flex-shrink: 0;
    min-width: 38px; /* Noch kleiner */
    padding: 8px 10px; /* Gleiche Höhe wie Kontakt */
}

.card-cta .btn-favorite-grid .heart-icon {
    width: 16px; /* Kleineres Icon */
    height: 16px;
}

/* Responsive Grid Buttons */
@media (max-width: 768px) {
    .btn-favorite-grid {
        min-width: 44px;
        padding: 10px 12px;
    }
    
    .btn-favorite-grid .heart-icon {
        width: 18px;
        height: 18px;
    }
}

