/**
 * Favoriten-System Styles
 * 
 * @package LebeBewusst
 * @since 1.0.0
 */

/* === FAVORITEN-BUTTON === */
.lb-favorite-button-container {
    display: inline-block;
    position: relative;
}

.lb-favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.lb-favorite-btn:focus {
    outline: 2px solid var(--e-global-color-primary, #007cba);
    outline-offset: 2px;
}

/* Inaktiver Zustand */
.lb-favorite-inactive {
    color: #666;
    background: rgba(102, 102, 102, 0.1);
}

.lb-favorite-inactive:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
    transform: translateY(-1px);
}

.lb-favorite-inactive i {
    color: #666;
    transition: all 0.3s ease;
}

.lb-favorite-inactive:hover i {
    color: #e74c3c;
    transform: scale(1.1);
}

/* Aktiver Zustand */
.lb-favorite-active {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.lb-favorite-active:hover {
    color: #c0392b;
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-1px);
}

.lb-favorite-active i {
    color: #e74c3c;
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Herz-Animation */
@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* Hinzufügen-Animation */
.lb-favorite-added {
    animation: favoriteAdded 0.6s ease-out;
}

@keyframes favoriteAdded {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Loading State */
.lb-favorite-btn.lb-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.lb-favorite-btn.lb-loading i {
    animation: spin 1s linear infinite;
}

/* Icon Display Fix - stellt sicher dass Icons sichtbar sind */
.lb-favorite-btn i {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: 1em !important;
    min-height: 1em !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* Spezifische Fixes für Elementor Icons */
.lb-favorite-btn i.eicon-star,
.lb-favorite-btn i.eicon-star-filled {
    font-family: 'eicons', 'Font Awesome 5 Free', 'FontAwesome', sans-serif !important;
    font-size: 18px !important;
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    text-align: center !important;
}

/* Fallback für Icons falls Elementor nicht verfügbar */
.lb-favorite-btn i.eicon-star:before {
    content: "★" !important;
    font-family: sans-serif !important;
}

.lb-favorite-btn i.eicon-star-filled:before {
    content: "★" !important;
    font-family: sans-serif !important;
    color: #FFD700 !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Favoriten-Count */
.lb-favorite-count {
    background: var(--e-global-color-primary, #007cba);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

.lb-favorite-active .lb-favorite-count {
    background: #e74c3c;
}

/* Text-Styling */
.lb-favorite-text {
    font-size: 14px;
    font-weight: 500;
}

/* === GÄSTE-BENACHRICHTIGUNG === */
.lb-favorite-guest-notice {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.lb-favorite-guest-notice p {
    margin: 0;
    color: #856404;
}

.lb-favorite-guest-notice .lb-login-link {
    color: #007cba;
    font-weight: 600;
    text-decoration: none;
}

.lb-favorite-guest-notice .lb-login-link:hover {
    text-decoration: underline;
}

/* === NOTIFICATION SYSTEM === */
.lb-favorite-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.lb-notification-content {
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lb-notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

.lb-close-notification {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.lb-close-notification:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Notification Types */
.lb-notification-success {
    border-left: 4px solid #28a745;
}

.lb-notification-success .lb-notification-message {
    color: #155724;
}

.lb-notification-error {
    border-left: 4px solid #dc3545;
}

.lb-notification-error .lb-notification-message {
    color: #721c24;
}

.lb-notification-info {
    border-left: 4px solid #007cba;
}

.lb-notification-info .lb-notification-message {
    color: #004085;
}

.lb-notification-info .lb-login-link {
    color: #007cba;
    font-weight: 600;
    text-decoration: none;
}

.lb-notification-info .lb-login-link:hover {
    text-decoration: underline;
}

/* === BUTTON VARIANTS === */

/* Icon-only Button */
.lb-favorite-btn.lb-style-icon {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
}

.lb-favorite-btn.lb-style-icon .lb-favorite-text {
    display: none;
}

/* Button with Text */
.lb-favorite-btn.lb-style-button {
    padding: 10px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
}

.lb-favorite-btn.lb-style-button:hover {
    border-color: var(--e-global-color-primary, #007cba);
    background: var(--e-global-color-primary, #007cba);
    color: white;
}

.lb-favorite-btn.lb-style-button.lb-favorite-active {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

/* Text-only Button */
.lb-favorite-btn.lb-style-text {
    padding: 6px 12px;
    background: none;
    border: none;
    text-decoration: underline;
}

.lb-favorite-btn.lb-style-text:hover {
    background: rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .lb-favorite-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .lb-favorite-guest-notice {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        z-index: 1000;
    }
    
    .lb-favorite-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .lb-favorite-btn.lb-style-button {
        padding: 8px 12px;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    .lb-favorite-btn,
    .lb-favorite-btn i,
    .lb-favorite-notification {
        animation: none;
        transition: none;
    }
    
    .lb-favorite-active i {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .lb-favorite-inactive {
        border: 2px solid #666;
    }
    
    .lb-favorite-active {
        border: 2px solid #e74c3c;
    }
    
    .lb-favorite-notification {
        border: 2px solid #000;
    }
}

/* === CARD INTEGRATION === */
.lb-card .lb-favorite-btn,
.lb-favorite-card-actions .lb-favorite-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.lb-card .lb-favorite-btn i,
.lb-favorite-card-actions .lb-favorite-btn i {
    font-size: 18px;
}

.lb-card .lb-favorite-btn:hover,
.lb-favorite-card-actions .lb-favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.15);
}

.lb-favorite-card-actions .lb-favorite-btn.lb-favorite-active {
    background: rgba(231, 76, 60, 0.15);
}

.lb-favorite-card-actions .lb-favorite-btn.lb-favorite-inactive {
    background: rgba(255, 255, 255, 0.95);
}

/* Single Page Integration */
.lb-single-header .lb-favorite-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.lb-single-title-row .lb-favorite-btn {
    margin-left: 15px;
}

/* === FAVORITEN-WIDGET === */
.lb-favorites-widget {
    padding: 20px;
}

.lb-favorites-title {
    font-size: 24px;
    font-weight: 600;
    color: #191970;
    margin: 0 0 20px 0;
    text-align: center;
}

.lb-favorites-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.lb-favorites-empty-icon {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.lb-favorites-empty h3 {
    font-size: 20px;
    color: #191970;
    margin: 0 0 10px 0;
}

.lb-favorites-empty p {
    color: #666;
    margin: 0 0 15px 0;
}

.lb-favorites-empty .lb-login-link {
    color: #007cba;
    font-weight: 600;
    text-decoration: none;
}

.lb-favorites-empty .lb-login-link:hover {
    text-decoration: underline;
}

/* Grid Layout */
.lb-favorites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* List Layout */
.lb-favorites-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lb-favorites-list .lb-favorite-item {
    display: flex;
    gap: 15px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lb-favorites-list .lb-favorite-item-image {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
}

.lb-favorites-list .lb-favorite-item-content {
    flex: 1;
}

/* Favorite Item */
.lb-favorite-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.lb-favorite-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lb-favorite-item-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

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

.lb-favorite-item:hover .lb-favorite-item-image img {
    transform: scale(1.05);
}

.lb-favorite-placeholder {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 32px;
}

.lb-favorite-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-favorite-type {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.lb-favorite-item-content {
    padding: 15px;
}

.lb-favorite-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #191970;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.lb-favorite-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.lb-favorite-item-title a:hover {
    color: #007cba;
}

.lb-favorite-item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.lb-favorite-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lb-favorite-item-excerpt {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 1024px) {
    .lb-favorites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .lb-favorites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .lb-favorites-list .lb-favorite-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .lb-favorites-list .lb-favorite-item-image {
        width: 100%;
        height: 120px;
    }
    
    .lb-favorites-empty {
        padding: 30px 15px;
    }
    
    .lb-favorites-empty-icon {
        font-size: 36px;
    }
}
