/**
 * HD Bookmark Styles
 */

/* ===== Bookmark Button ===== */
.hd-bookmark-wrapper {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.hd-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--hd-bookmark-color, #e11d48);
    border-radius: 50px;
    background: var(--hd-btn-bg, transparent);
    color: var(--hd-text-color, var(--hd-bookmark-color, #e11d48));
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hd-bookmark-btn:hover {
    background: var(--hd-bookmark-color, #e11d48);
    color: #fff;
}

.hd-bookmark-btn.is-bookmarked {
    background: var(--hd-bookmark-color, #e11d48);
    color: #fff;
}

.hd-bookmark-btn.is-bookmarked:hover {
    background: transparent;
    color: var(--hd-bookmark-color, #e11d48);
}

.hd-bookmark-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-bookmark-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.hd-bookmark-btn.is-bookmarked .hd-bookmark-icon svg {
    fill: currentColor;
}

.hd-bookmark-btn:hover .hd-bookmark-icon svg {
    transform: scale(1.1);
}

/* ===== Size Variants ===== */
/* Small */
.hd-bookmark-wrapper.size-small .hd-bookmark-btn,
.hd-bookmark-collection-link.size-small {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
}
.hd-bookmark-wrapper.size-small .hd-bookmark-icon svg,
.hd-bookmark-collection-link.size-small svg {
    width: 14px;
    height: 14px;
}

/* Medium (default) */
.hd-bookmark-wrapper.size-medium .hd-bookmark-btn,
.hd-bookmark-collection-link.size-medium {
    padding: 10px 20px;
    font-size: 14px;
    gap: 6px;
}
.hd-bookmark-wrapper.size-medium .hd-bookmark-icon svg,
.hd-bookmark-collection-link.size-medium svg {
    width: 18px;
    height: 18px;
}

/* Large */
.hd-bookmark-wrapper.size-large .hd-bookmark-btn,
.hd-bookmark-collection-link.size-large {
    padding: 14px 28px;
    font-size: 16px;
    gap: 8px;
}
.hd-bookmark-wrapper.size-large .hd-bookmark-icon svg,
.hd-bookmark-collection-link.size-large svg {
    width: 22px;
    height: 22px;
}

/* ===== Prefix Text & Background Wrapper ===== */
.hd-bookmark-prefix-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hd-bookmark-prefix-text {
    color: var(--hd-bookmark-color, #e11d48);
    font-size: 14px;
    font-weight: 500;
}

/* With Background */
.hd-bookmark-prefix-wrapper.has-background {
    background: rgba(225, 29, 72, 0.08);
    padding: 16px 24px;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.hd-bookmark-prefix-wrapper.has-background .hd-bookmark-wrapper {
    margin: 0;
}

/* ===== Collection Link ===== */
.hd-bookmark-collection-link,
#si-single-content .hd-bookmark-collection-link,
.entry-content .hd-bookmark-collection-link,
a.hd-bookmark-collection-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--hd-bookmark-color, #e11d48) !important;
    border-radius: 50px;
    background: var(--hd-btn-bg, transparent);
    color: var(--hd-text-color, var(--hd-bookmark-color, #e11d48)) !important;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hd-bookmark-collection-link:hover,
#si-single-content .hd-bookmark-collection-link:hover,
.entry-content .hd-bookmark-collection-link:hover,
a.hd-bookmark-collection-link:hover {
    background: var(--hd-bookmark-color, #e11d48) !important;
    color: #fff !important;
}

.hd-bookmark-collection-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.hd-bookmark-collection-link:hover svg {
    transform: scale(1.1);
}

/* ===== Size Classes ===== */
/* Small Size */
.hd-bookmark-wrapper.size-small .hd-bookmark-btn,
.size-small.hd-bookmark-collection-link,
#si-single-content .size-small.hd-bookmark-collection-link,
.entry-content .size-small.hd-bookmark-collection-link,
a.size-small.hd-bookmark-collection-link {
    padding: 8px 16px !important;
    font-size: 13px !important;
    gap: 5px !important;
}

.hd-bookmark-wrapper.size-small .hd-bookmark-icon svg,
.size-small.hd-bookmark-collection-link svg {
    width: 16px !important;
    height: 16px !important;
}

/* Medium Size (default) */
.hd-bookmark-wrapper.size-medium .hd-bookmark-btn,
.size-medium.hd-bookmark-collection-link,
#si-single-content .size-medium.hd-bookmark-collection-link,
.entry-content .size-medium.hd-bookmark-collection-link,
a.size-medium.hd-bookmark-collection-link {
    padding: 12px 24px !important;
    font-size: 16px !important;
    gap: 8px !important;
}

.hd-bookmark-wrapper.size-medium .hd-bookmark-icon svg,
.size-medium.hd-bookmark-collection-link svg {
    width: 20px !important;
    height: 20px !important;
}

/* Large Size */
.hd-bookmark-wrapper.size-large .hd-bookmark-btn,
.size-large.hd-bookmark-collection-link,
#si-single-content .size-large.hd-bookmark-collection-link,
.entry-content .size-large.hd-bookmark-collection-link,
a.size-large.hd-bookmark-collection-link {
    padding: 16px 32px !important;
    font-size: 18px !important;
    gap: 10px !important;
}

.hd-bookmark-wrapper.size-large .hd-bookmark-icon svg,
.size-large.hd-bookmark-collection-link svg {
    width: 24px !important;
    height: 24px !important;
}

/* Auto wrapper styles */
.hd-bookmark-auto-wrapper,
.hd-bookmark-shortcode-wrapper,
.isb-bookmark-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 15px 0;
}

.hd-bookmark-auto-wrapper .hd-bookmark-wrapper,
.hd-bookmark-shortcode-wrapper .hd-bookmark-wrapper {
    margin: 0;
}

/* ===== Box Module Bookmark Row ===== */
/* Bookmark row container - forces second row */
.social-button-wrapper .bookmark-row {
    flex-basis: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    order: 100;
}

.social-button-wrapper .bookmark-row .bookmark-item {
    display: flex;
    align-items: center;
}

/* Unified button styles matching social buttons */
.social-button-wrapper .bookmark-row .hd-bookmark-btn,
.social-button-wrapper .bookmark-row .hd-bookmark-collection-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 100px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
    height: auto;
}

/* Bookmark button - filled style */
.social-button-wrapper .bookmark-row .hd-bookmark-btn {
    background: var(--hd-bookmark-color, #e11d48);
    border: none;
    color: #fff !important;
}

.social-button-wrapper .bookmark-row .hd-bookmark-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
    opacity: 0.95;
}

.social-button-wrapper .bookmark-row .hd-bookmark-btn.is-bookmarked {
    background: var(--hd-bookmark-color, #e11d48);
}

/* Collection link - outline style */
.social-button-wrapper .bookmark-row .hd-bookmark-collection-link {
    background: transparent;
    border: 2px solid var(--hd-bookmark-color, #e11d48) !important;
    color: var(--hd-bookmark-color, #e11d48) !important;
}

.social-button-wrapper .bookmark-row .hd-bookmark-collection-link:hover {
    background: var(--hd-bookmark-color, #e11d48) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Icon sizes - unified */
.social-button-wrapper .bookmark-row .hd-bookmark-icon svg,
.social-button-wrapper .bookmark-row .hd-bookmark-collection-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Reset wrapper margin */
.social-button-wrapper .bookmark-row .hd-bookmark-wrapper {
    margin: 0;
}

/* Mobile RWD - Hide text on small screens */
@media (max-width: 768px) {
    .social-button-wrapper .bookmark-row .hd-bookmark-text,
    .social-button-wrapper .bookmark-row .hd-bookmark-collection-link span {
        display: none;
    }
    
    .social-button-wrapper .bookmark-row .hd-bookmark-btn,
    .social-button-wrapper .bookmark-row .hd-bookmark-collection-link {
        min-width: auto;
        padding: 8px 12px;
    }
}

/* ===== Toast Notification ===== */
.hd-bookmark-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.hd-bookmark-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Bookmark List ===== */
.hd-bookmark-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hd-bookmark-header {
    margin-bottom: 30px;
    text-align: center;
}

.hd-bookmark-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.hd-bookmark-count-wrap {
    color: #666;
    font-size: 14px;
}

.hd-bookmark-loading,
.hd-bookmark-empty,
.hd-bookmark-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.hd-bookmark-empty {
    background: #f9f9f9;
    border-radius: 12px;
}

/* ===== Grid Layout ===== */
.hd-bookmark-list.hd-bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.hd-bookmark-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.hd-bookmark-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.hd-bookmark-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.hd-bookmark-card-image {
    position: relative;
    padding-top: 56.25%;
    background: #f0f0f0;
    overflow: hidden;
}

.hd-bookmark-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hd-bookmark-card:hover .hd-bookmark-card-image img {
    transform: scale(1.05);
}

.hd-bookmark-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hd-bookmark-card-content {
    padding: 16px;
}

.hd-bookmark-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hd-bookmark-card-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hd-bookmark-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.hd-bookmark-card:hover .hd-bookmark-remove {
    opacity: 1;
}

.hd-bookmark-remove:hover {
    background: #e11d48;
}

.hd-bookmark-remove svg {
    width: 16px;
    height: 16px;
}

/* ===== List Layout ===== */
.hd-bookmark-list.hd-bookmark-list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hd-bookmark-list-view .hd-bookmark-card {
    display: flex;
    align-items: stretch;
}

.hd-bookmark-list-view .hd-bookmark-card-link {
    display: flex;
    flex: 1;
}

.hd-bookmark-list-view .hd-bookmark-card-image {
    width: 200px;
    padding-top: 0;
    flex-shrink: 0;
}

.hd-bookmark-list-view .hd-bookmark-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== Compact Layout ===== */
.hd-bookmark-list.hd-bookmark-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hd-bookmark-compact .hd-bookmark-card {
    display: flex;
    align-items: center;
    padding: 12px;
}

.hd-bookmark-compact .hd-bookmark-card-image {
    width: 60px;
    height: 60px;
    padding-top: 0;
    border-radius: 8px;
    flex-shrink: 0;
}

.hd-bookmark-compact .hd-bookmark-card-content {
    padding: 0 12px;
}

.hd-bookmark-compact .hd-bookmark-card-title {
    font-size: 1rem;
    margin-bottom: 4px;
}

.hd-bookmark-compact .hd-bookmark-card-excerpt {
    display: none;
}

.hd-bookmark-compact .hd-bookmark-remove {
    position: relative;
    top: auto;
    right: auto;
    opacity: 1;
    background: #f0f0f0;
    color: #666;
}

.hd-bookmark-compact .hd-bookmark-remove:hover {
    background: #e11d48;
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hd-bookmark-list.hd-bookmark-grid {
        grid-template-columns: 1fr;
    }
    
    .hd-bookmark-list-view .hd-bookmark-card {
        flex-direction: column;
    }
    
    .hd-bookmark-list-view .hd-bookmark-card-image {
        width: 100%;
        padding-top: 56.25%;
    }
    
    .hd-bookmark-remove {
        opacity: 1;
    }
}
