/* WhatsApp DP Gallery Styles */

/* Gallery Grid */
.wdp-gallery {
    display: grid;
    grid-gap: 20px;
    margin: 20px 0;
    padding: 0;
}

.wdp-gallery[data-columns="2"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.wdp-gallery[data-columns="3"] {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.wdp-gallery[data-columns="4"] {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.wdp-gallery[data-columns="5"] {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Gallery Item */
.wdp-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #fff;
}

.wdp-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.wdp-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.wdp-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.wdp-item:hover .wdp-image {
    transform: scale(1.05);
}

/* Overlay */
.wdp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 15px;
}

.wdp-item:hover .wdp-overlay {
    opacity: 1;
}

.wdp-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

/* Buttons */
.wdp-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 20px;
    padding: 8px 12px;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wdp-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wdp-btn-download {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.wdp-btn-download:hover {
    background: linear-gradient(135deg, #128C7E, #25D366);
}

.wdp-btn-share {
    background: linear-gradient(135deg, #1DA1F2, #0d8bd9);
    color: white;
}

.wdp-btn-share:hover {
    background: linear-gradient(135deg, #0d8bd9, #1DA1F2);
}

.wdp-btn-favorite {
    background: linear-gradient(135deg, #E1306C, #C13584);
    color: white;
    min-width: 36px;
    justify-content: center;
}

.wdp-btn-favorite:hover {
    background: linear-gradient(135deg, #C13584, #E1306C);
}

.wdp-btn-favorite.favorited {
    background: linear-gradient(135deg, #ff4458, #e91e63);
}

.wdp-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Meta Information */
.wdp-meta {
    padding: 15px;
}

.wdp-title {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wdp-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wdp-category {
    background: #f0f8ff;
    color: #1e90ff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* Lightbox */
.wdp-lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.wdp-lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.wdp-lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.wdp-close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    transition: color 0.3s ease;
}

.wdp-close:hover {
    color: #ff4458;
}

.wdp-lightbox-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.wdp-lightbox-actions .wdp-btn {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 25px;
}

/* Loading States */
.wdp-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.wdp-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wdp-gallery {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
        grid-gap: 12px;
        margin: 15px 0;
    }
    
    .wdp-item {
        border-radius: 8px;
    }
    
    .wdp-overlay {
        padding: 10px;
    }
    
    .wdp-actions {
        gap: 5px;
    }
    
    .wdp-btn {
        padding: 6px 8px;
        font-size: 10px;
        border-radius: 15px;
    }
    
    .wdp-btn .dashicons {
        font-size: 12px;
        width: 12px;
        height: 12px;
    }
    
    .wdp-meta {
        padding: 10px;
    }
    
    .wdp-title {
        font-size: 12px;
    }
    
    .wdp-category {
        padding: 1px 6px;
        font-size: 10px;
    }
    
    .wdp-lightbox-content {
        padding: 10px;
        width: 95%;
    }
    
    .wdp-lightbox-image {
        max-height: 60vh;
    }
    
    .wdp-close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
    
    .wdp-lightbox-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 200px;
    }
    
    .wdp-lightbox-actions .wdp-btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wdp-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wdp-item {
        background: #2d2d2d;
        color: #fff;
    }
    
    .wdp-title {
        color: #fff;
    }
    
    .wdp-category {
        background: #404040;
        color: #87CEEB;
    }
}

/* Accessibility */
.wdp-btn:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.wdp-image:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .wdp-overlay,
    .wdp-lightbox {
        display: none !important;
    }
    
    .wdp-item {
        break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wdp-item {
        border: 2px solid #000;
    }
    
    .wdp-btn {
        border: 2px solid #000;
        font-weight: bold;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wdp-item,
    .wdp-image,
    .wdp-overlay,
    .wdp-btn {
        transition: none;
    }
    
    .wdp-item:hover {
        transform: none;
    }
    
    .wdp-item:hover .wdp-image {
        transform: none;
    }
}
