/**
 * CANIS Favorites Styles
 */

/* Favorite Star Container */
.favorite-star-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Favorite Star Button */
.favorite-star {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    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.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.favorite-star:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-star.processing {
    opacity: 0.6;
    cursor: not-allowed;
}

.favorite-star.login-required {
    opacity: 0.7;
    cursor: pointer;
}

.favorite-star.login-required:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 1);
}

/* Star Icon */
.favorite-star .star-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.favorite-star .star-icon svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

/* Default state - white outline, no fill */
.favorite-star .star-icon svg path {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
}

/* Favorited state - white filled star */
.favorite-star.favorited .star-icon svg path {
    fill: #ffffff;
    stroke: #ffffff;
}

/* Hover effects - orange outline with white background */
.favorite-star:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-star:hover .star-icon svg path {
    fill: none;
    stroke: #D25D2E;
    stroke-width: 2;
}

/* Favorited hover state - orange filled with white background */
.favorite-star.favorited:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.favorite-star.favorited:hover .star-icon svg path {
    fill: #D25D2E;
    stroke: #D25D2E;
}

/* Animation for toggle */
.favorite-star.animate {
    animation: favoriteToggle 0.3s ease;
}

@keyframes favoriteToggle {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Post Image Container positioning */
.post-image-container {
    position: relative;
    overflow: hidden;
}

/* Ensure image container has relative positioning for absolute star positioning */
.canis-filtered-posts .inner-wrap .img-link,
.canis-filtered-posts .inner-wrap .post-featured-img {
    position: relative;
    display: block;
}

/* Favorites page specific styles */
.ihc-account-favorites-empty {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px 0;
    background: #f9f9f9;
}

.ihc-account-favorites-empty p {
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.ihc-account-favorites-empty .canis-btn {
    display: inline-block;
    padding: 12px 24px;
    background: white !important;
    color: #333 !important;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid #D25D2E;
    transition: all 0.3s ease;
}

.ihc-account-favorites-empty .canis-btn:hover {
    background: #D25D2E !important;
    color: white !important;
    text-decoration: none;
}

/* Higher specificity selectors to override theme classes */
.ihc-account-favorites-empty .canis-btn.btn-more,
.ihc-account-favorites-empty a.canis-btn.btn-more,
.ihc-ap-wrap .ihc-account-favorites-empty .canis-btn {
    background: white !important;
    color: #333 !important;
    border: 2px solid #D25D2E !important;
}

.ihc-account-favorites-empty .canis-btn.btn-more:hover,
.ihc-account-favorites-empty a.canis-btn.btn-more:hover,
.ihc-ap-wrap .ihc-account-favorites-empty .canis-btn:hover {
    background: #D25D2E !important;
    color: white !important;
}

.ihc-account-favorites-list {
    margin-top: 20px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Responsive grid */
@media (max-width: 1200px) {
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .favorites-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.favorite-post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.favorite-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: #D25D2E;
}

.favorite-post-item .article-content-wrap {
    padding: 12px;
}

.favorite-post-item .title {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.favorite-post-item .excerpt-text {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.favorite-post-item .btn-more {
    background: #D25D2E;
    color: white !important;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s ease;
}

.favorite-post-item .btn-more:hover {
    background: #B54724;
    color: white;
}

/* Integration with existing post grid */
.canis-filtered-posts.favorites-grid .col.span_6 {
    width: 100%;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .favorite-star-container {
        top: 8px;
        right: 8px;
    }

    .favorite-star {
        width: 35px;
        height: 35px;
    }

    .favorite-star .star-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .favorites-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .favorite-post-item .article-content-wrap {
        padding: 12px;
    }
}

/* Integration with existing post list styles */
.canis-filtered-posts .col.span_6 .inner-wrap {
    position: relative;
}

/* Ensure star appears above other elements */
.favorite-star-container {
    z-index: 15;
}

/* Style adjustments for different post layouts */
.portfolio-items .col .inner-wrap .favorite-star-container,
.blog-recent .col .inner-wrap .favorite-star-container {
    top: 15px;
    right: 15px;
}

/* Account page tab styling improvements */
.ihc-account-tab-favorites {
    padding: 20px 0;
}

.ihc-account-tab-favorites h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

/* Loading state */
.favorite-star.processing .star-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Override theme styles that might interfere */
.favorite-star-container a,
.favorite-star-container button {
    text-decoration: none !important;
}

/* Ensure favorite star doesn't interfere with image hover effects */
.post-image-container:hover .favorite-star-container {
    opacity: 1;
}

/* Make favorite stars always visible */
.favorite-star-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Stars are now always visible - no need for hover states */

/* Always show on touch devices */
@media (hover: none) {
    .favorite-star-container {
        opacity: 1;
    }
}

/* IHC Account page integration */
.ihc-ap-wrap .favorites-grid {
    margin-top: 0;
}

.ihc-ap-wrap h3+.ihc-account-favorites-list {
    margin-top: 0;
}

/* Single post favorite star positioning - within header area */
.single-post-favorite-star {
    position: absolute;
    top: 220px;
    right: 38px;
    z-index: 999;
}

.single-post-favorite-star .favorite-star-container {
    position: relative;
    top: auto;
    right: auto;
}

/* Ensure the star appears above header content */
#page-header-bg,
.page-header-no-bg {
    position: relative;
}

/* For fullscreen headers */
.fullscreen-blog-header .single-post-favorite-star {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
}

/* Responsive positioning for single post star */
@media (max-width: 768px) {

    .fullscreen-blog-header .single-post-favorite-star {
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {

    .fullscreen-blog-header .single-post-favorite-star {
        top: 15px;
        right: 15px;
    }

    .single-post-favorite-star .favorite-star {
        width: 35px;
        height: 35px;
    }

    .single-post-favorite-star .favorite-star .star-icon svg {
        width: 18px;
        height: 18px;
    }
}