/* CSS for Visual Paradigm Gallery Masonry & Filter Plugin */

.vp-gallery-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Filter Header */
.vp-gallery-filter-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.vp-filter-title {
    margin: 0 0 16px 0 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.vpg-select-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex-grow: 1;
}

/* Live Search Box */
.vpg-search-box {
    position: relative;
    min-width: 200px;
    flex: 1;
    max-width: 320px;
}

.vpg-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.vpg-search-input {
    width: 100% !important;
    padding: 10px 36px 10px 36px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
}

.vpg-search-input:hover {
    border-color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
}

.vpg-search-input:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15) !important;
    background-color: #ffffff !important;
}

.vpg-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 16px !important;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px !important;
    line-height: 1;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.vpg-search-clear:hover {
    color: #0f172a !important;
}

.vpg-hidden {
    display: none !important;
}

.vpg-filter-select {
    min-width: 180px;
    flex: 1;
    max-width: 280px;
    padding: 10px 14px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    outline: none !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 32px !important;
    transition: all 0.2s ease;
}

.vpg-filter-select:hover {
    border-color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
}

.vpg-filter-select:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15) !important;
    background-color: #ffffff !important;
}

/* Active filter badge */
.vpg-slider-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.vpg-slider-label {
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vpg-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 160px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.vpg-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0ea5e9;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s ease;
}

.vpg-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.vp-active-filters {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.vp-filter-label {
    font-weight: 600;
}

.vp-filter-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vp-clear-filter-btn {
    text-decoration: none !important;
    color: #0369a1 !important;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
}

.vp-clear-filter-btn:hover {
    color: #0284c7 !important;
}

/* Pinterest Masonry layout grid - 100% page width */
.vp-masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 10px; /* Base grid spacing for masonry */
    gap: 16px;
    width: 100%;
}

.vp-gallery-card {
    grid-row-end: span 20; /* Default card height span */
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.vp-gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    border-color: #e2e8f0;
}

/* Image container & Hover actions overlay */
.vp-card-media-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8fafc;
}

.vp-gallery-img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    object-fit: cover;
}

.vp-card-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(1px);
}

.vp-gallery-card:hover .vp-card-hover-overlay {
    opacity: 1;
}

.vp-hover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 85%;
    max-width: 160px;
}

.vp-action-btn {
    position: relative;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 9999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, border-color 0.2s ease !important;
    padding: 6px 14px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.vp-action-btn:hover {
    transform: translateY(-2px) scale(1.02);
    background: #0ea5e9 !important;
    color: #ffffff !important;
    border-color: #0ea5e9 !important;
}

/* Quick Tooltip */
.vp-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.vp-action-btn:hover .vp-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Card Information Details */
.vp-card-details {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.vp-card-title {
    margin: 0 0 6px 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #0f172a !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.vp-card-title a {
    color: #0f172a !important;
    text-decoration: none !important;
}

.vp-card-title a:hover {
    color: #0ea5e9 !important;
    text-decoration: underline !important;
}

.vp-card-admin-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.vp-delete-post-btn {
    background-color: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fca5a5 !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    line-height: 1.4 !important;
}

.vp-delete-post-btn:hover {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
}

.vp-card-excerpt {
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #475569 !important;
    flex-grow: 1;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Custom Notification Toast */
.vp-toast-alert {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 9999px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    z-index: 999999;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.vp-toast-alert.vp-toast-visible {
    transform: translateX(-50%) translateY(0);
}

/* Empty gallery indicator */
.vp-empty-gallery {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    color: #64748b;
    max-width: 480px;
    margin: 40px auto;
}

.vp-empty-gallery svg {
    margin-bottom: 12px;
    color: #94a3b8;
}

.vp-empty-gallery p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Premium Responsive Lightbox Overlay */
.vpg-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.vpg-lightbox-overlay.vpg-active {
    display: flex;
    opacity: 1;
}

.vpg-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: vpgZoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vpgZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.vpg-lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.vpg-lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    color: #f8fafc;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.vpg-lightbox-close:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.vpg-lightbox-details {
    margin-top: 16px;
    text-align: center;
    color: #f8fafc;
    max-width: 600px;
}

.vpg-lightbox-excerpt {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 10px 0;
    color: #cbd5e1;
}

.vpg-lightbox-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
}

.vpg-lightbox-btn {
    color: #38bdf8 !important;
    text-decoration: none !important;
    font-weight: 700;
    transition: color 0.2s;
}

.vpg-lightbox-btn:hover {
    color: #7dd3fc !important;
    text-decoration: underline !important;
}
