/* Favorite Activities Plugin Styles */

/* Favorite Button Styles */
.fav-button {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    user-select: none;
}

.fav-button:hover {
    background: #e0e0e0;
    text-decoration: none;
    color: #333;
}

.fav-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}
/* Shop Loop */
.wc-loop-favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.wc-loop-favorite-button .fav-button {
    padding: 8px 12px;
    border-radius: 50%;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
    font-size: 16px;
    line-height: 1;
    font-weight: normal;
}

/* Ensure heart icons are preserved */
.wc-loop-favorite-button .fav-button.fav-add {
    background: rgba(255,255,255,0.9);
    border-color: #007cba;
    color: #007cba;
}

.wc-loop-favorite-button .fav-button.fav-remove {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}dd {
    background: #fff;
    border-color: #007cba;
    color: #007cba;
}

.fav-button.fav-add:hover {
    background: #007cba;
    color: #fff;
}

.fav-button.fav-remove {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.fav-button.fav-remove:hover {
    background: #c82333;
    border-color: #bd2130;
}

.fav-button.fav-login {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.fav-button.fav-login:hover {
    background: #218838;
    border-color: #1e7e34;
    color: #fff;
}

/* Icon-only buttons */
.fav-button:not(:contains(' ')) {
    padding: 8px 12px;
    font-size: 16px;
    min-width: auto;
}

/* Favorites List Styles */
.fav-activities-list {
    margin: 20px 0;
}

.fav-activity-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.fav-activity-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.fav-activity-content {
    flex: 1;
    margin-right: 15px;
}

.fav-activity-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.fav-activity-title a {
    color: #333;
    text-decoration: none;
}

.fav-activity-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

.fav-activity-excerpt {
    margin: 10px 0;
    color: #666;
    line-height: 1.5;
}

.fav-activity-date {
    margin-top: 10px;
}

.fav-activity-date small {
    color: #999;
    font-size: 12px;
}

.fav-activity-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Popular Activities Styles */
.fav-popular-activities {
    margin: 20px 0;
}

.fav-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fav-popular-item {
    padding: 10px 15px;
    margin-bottom: 5px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fav-popular-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.fav-popular-item a:hover {
    color: #007cba;
    text-decoration: underline;
}

.fav-count {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

/* WooCommerce Product Favorites - Grid and List Views */

/* Container and Controls */
.fav-activities-container {
    margin: 20px 0;
}

.fav-view-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.fav-view-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.fav-view-btn {
    padding: 8px 16px;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.fav-view-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.fav-view-btn.active {
    background: #007cba;
    color: #fff;
}

.fav-view-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Grid View Styles */
.fav-activities-list.fav-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.fav-grid-view .fav-activity-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.fav-grid-view .fav-activity-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.fav-grid-view .fav-activity-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.fav-grid-view .fav-activity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fav-grid-view .fav-activity-item:hover .fav-activity-image img {
    transform: scale(1.05);
}

.fav-grid-view .fav-activity-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fav-grid-view .fav-activity-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.4;
}

.fav-grid-view .fav-activity-title a {
    color: #333;
    text-decoration: none;
}

.fav-grid-view .fav-activity-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

.fav-grid-view .fav-activity-price {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 10px;
}

.fav-grid-view .fav-activity-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    flex: 1;
}

.fav-grid-view .fav-activity-actions {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

/* List View Styles */
.fav-activities-list.fav-list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.fav-list-view .fav-activity-item {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.fav-list-view .fav-activity-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.fav-list-view .fav-activity-image {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    background: #f5f5f5;
    overflow: hidden;
}

.fav-list-view .fav-activity-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fav-list-view .fav-activity-content {
    padding: 15px;
    flex: 1;
    min-width: 0;
}

.fav-list-view .fav-activity-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    line-height: 1.4;
}

.fav-list-view .fav-activity-title a {
    color: #333;
    text-decoration: none;
}

.fav-list-view .fav-activity-title a:hover {
    color: #007cba;
    text-decoration: underline;
}

.fav-list-view .fav-activity-price {
    font-size: 16px;
    font-weight: bold;
    color: #007cba;
    margin-bottom: 8px;
}

.fav-list-view .fav-activity-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.fav-list-view .fav-activity-actions {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* Play Button Styles */
.fav-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fav-activity-item:hover .fav-play-overlay {
    opacity: 1;
}

.fav-play-btn {
    background: #fff;
    border: 2px solid #007cba;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    color: #007cba;
}

.fav-play-btn:hover {
    transform: scale(1.1);
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.fav-play-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.fav-play-btn-large {
    background: #007cba;
    color: #fff;
    border: 2px solid #007cba;
    border-radius: 4px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.fav-play-btn-large:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.fav-play-btn-large .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Loading states */
.fav-play-btn.fav-loading,
.fav-play-btn-large.fav-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No image fallback */
.fav-activity-image.fav-no-image {
    background: #f5f5f5 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21,15 16,10 5,21"/></svg>') center/50px no-repeat;
    color: #ccc;
}

/* Price styling */
.fav-activity-price del {
    color: #999;
    font-weight: normal;
}

.fav-activity-price ins {
    text-decoration: none;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fav-activities-list.fav-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .fav-list-view .fav-activity-item {
        flex-direction: column;
    }
    
    .fav-list-view .fav-activity-image {
        width: 100%;
        height: 200px;
    }
    
    .fav-list-view .fav-activity-actions {
        flex-direction: row;
        padding: 15px;
    }
    
    .fav-view-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .fav-view-toggle {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .fav-activities-list.fav-grid-view {
        grid-template-columns: 1fr;
    }
    
    .fav-view-btn {
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* WooCommerce Integration Styles */

/* Single Product Page */
.wc-favorite-button-container {
    margin: 15px 0;
    text-align: center;
}

.wc-favorite-button-container .fav-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #999;
    padding: 0;
    min-width: 50px;
}

.wc-favorite-button-container .fav-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.wc-favorite-button-container .fav-button.fav-add {
    border-color: #007cba;
    color: #007cba;
}

.wc-favorite-button-container .fav-button.fav-add:hover {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.wc-favorite-button-container .fav-button.fav-remove {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.wc-favorite-button-container .fav-button.fav-remove:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: scale(1.1);
}

/* Shop Loop */
.wc-loop-favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.wc-loop-favorite-button .fav-button {
    padding: 8px;
    border-radius: 50%;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

/* My Account Favorites Tab */
.wc-favorites-content {
    padding: 20px 0;
}

.wc-favorites-content h3 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* Product Admin Column */
.column-favorites {
    width: 80px;
    text-align: center;
}

/* WooCommerce Product Grid Compatibility */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .wc-loop-favorite-button {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woocommerce ul.products li.product:hover .wc-loop-favorite-button {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wc-loop-favorite-button {
        position: static;
        margin: 10px 0;
        text-align: center;
    }
    
    .wc-loop-favorite-button .fav-button {
        border-radius: 4px;
        padding: 8px 16px;
        width: auto;
    }
    
    .woocommerce ul.products li.product .wc-loop-favorite-button {
        opacity: 1;
    }
    
    /* Single product page mobile */
    .wc-favorite-button-container .fav-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Dark theme support for WooCommerce */
@media (prefers-color-scheme: dark) {
    .wc-favorites-content h3 {
        color: #fff;
    }
}

/* Additional text and visibility fixes */
.fav-activity-excerpt {
    color: #666 !important;
}

.fav-activity-date {
    color: #999 !important;
}

.fav-activity-date small {
    color: #999 !important;
}

/* Ensure price text is visible */
.fav-activity-price {
    color: #007cba !important;
}

/* Fix any white text issues */
.fav-activities-list * {
    color: inherit;
}

.fav-activities-list .fav-activity-item {
    color: #333;
}

/* Ensure play button icons are visible */
.fav-play-btn .dashicons,
.fav-play-btn-large .dashicons {
    color: inherit !important;
}

/* Debug: Add temporary backgrounds to identify white text issues */
/*
.fav-activity-content {
    background: rgba(255,0,0,0.1);
}
*/
