/* assets/css/frontend.css - WP Media Gallery Pro Frontend Styles */

/* ==================================================
   Gallery Container
================================================== */

.wpmg-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ==================================================
   Category Filters
================================================== */

.wpmg-category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.wpmg-filter-btn {
    padding: 10px 25px;
    background: #f5f5f5;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.wpmg-filter-btn i {
    margin-right: 8px;
}

.wpmg-filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.wpmg-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ==================================================
   Search Box
================================================== */

.wpmg-search-box {
    display: flex;
    justify-content: center;
    margin-bottom: 35px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.wpmg-search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px 0 0 30px;
    outline: none;
    transition: all 0.3s;
    font-size: 15px;
}

.wpmg-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wpmg-search-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 500;
}

.wpmg-search-btn:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* ==================================================
   Gallery Grid
================================================== */

.wpmg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.wpmg-gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

/* ==================================================
   Image Card
================================================== */

.wpmg-image-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    cursor: pointer;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpmg-image-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.wpmg-image-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wpmg-image-card:hover img {
    transform: scale(1.05);
}

/* ==================================================
   Image Overlay
================================================== */

.wpmg-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    color: white;
    padding: 60px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.wpmg-image-card:hover .wpmg-image-overlay {
    transform: translateY(0);
}

.wpmg-image-overlay h3,
.wpmg-image-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

.wpmg-image-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.8);
}

.wpmg-image-stats i {
    margin-right: 5px;
}

.wpmg-view-btn {
    padding: 8px 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.wpmg-view-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

/* ==================================================
   Pagination & Load More
================================================== */

.wpmg-pagination {
    text-align: center;
    margin-top: 30px;
}

.wpmg-load-more {
    padding: 12px 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-block;
    margin: 30px auto 0;
}

.wpmg-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.wpmg-end-message {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* ==================================================
   Loading States
================================================== */

.wpmg-loader {
    text-align: center;
    padding: 60px;
    font-size: 16px;
    color: #667eea;
    grid-column: 1 / -1;
}

.wpmg-loader::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    margin-left: 10px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.wpmg-no-results,
.wpmg-error {
    text-align: center;
    padding: 60px;
    font-size: 18px;
    color: #999;
    grid-column: 1 / -1;
}

.wpmg-error {
    color: #e74c3c;
}

/* ==================================================
   Lightbox Styles
================================================== */

.wpmg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wpmg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wpmg-lightbox-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 40px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.wpmg-lightbox-close:hover {
    color: #667eea;
    transform: rotate(90deg);
}

.wpmg-lightbox-content img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.wpmg-lightbox-caption {
    padding: 20px;
    background: white;
}

.wpmg-lightbox-caption h3 {
    margin: 0 0 10px;
    color: #333;
    font-size: 20px;
}

.wpmg-lightbox-caption p {
    margin: 0 0 15px;
    color: #666;
    line-height: 1.6;
}

.wpmg-lightbox-stats {
    display: flex;
    gap: 20px;
    color: #999;
    font-size: 13px;
}

.wpmg-lightbox-stats i {
    margin-right: 5px;
    color: #667eea;
}

/* ==================================================
   Video Gallery Styles
================================================== */

.wpmg-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.wpmg-video-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.wpmg-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.wpmg-video-thumbnail {
    position: relative;
    overflow: hidden;
}

.wpmg-video-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.wpmg-video-card:hover .wpmg-video-thumbnail img {
    transform: scale(1.05);
}

.wpmg-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0.9;
}

.wpmg-video-card:hover .wpmg-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.wpmg-play-overlay i {
    font-size: 28px;
    color: #ff4757;
    margin-left: 5px;
}

.wpmg-video-info {
    padding: 15px;
}

.wpmg-video-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.4;
    color: #333;
}

.wpmg-video-channel {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.wpmg-video-stats {
    font-size: 11px;
    color: #bbb;
}

/* ==================================================
   Shorts Styles
================================================== */

.wpmg-shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.wpmg-shorts-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.wpmg-shorts-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.wpmg-shorts-thumbnail {
    position: relative;
}

.wpmg-shorts-thumbnail img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.wpmg-shorts-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: bold;
}

.wpmg-shorts-info {
    padding: 12px;
}

.wpmg-shorts-title {
    font-size: 12px;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    color: #333;
}

/* ==================================================
   Tabs Navigation
================================================== */

.wpmg-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.wpmg-tab-btn {
    padding: 10px 30px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    position: relative;
}

.wpmg-tab-btn.active {
    color: #667eea;
}

.wpmg-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 3px;
}

.wpmg-tab-btn:hover {
    color: #667eea;
}

/* ==================================================
   Single Image Shortcode
================================================== */

.wpmg-single-image {
    text-align: center;
}

.wpmg-single-image-link {
    display: inline-block;
    cursor: pointer;
}

.wpmg-single-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s;
}

.wpmg-single-image img:hover {
    transform: scale(1.02);
}

.wpmg-image-caption {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* ==================================================
   Widget Styles
================================================== */

.wpmg-widget-gallery {
    display: grid;
    gap: 15px;
}

.wpmg-widget-gallery.wpmg-layout-grid {
    grid-template-columns: repeat(2, 1fr);
}

.wpmg-widget-gallery.wpmg-layout-list {
    grid-template-columns: 1fr;
}

.wpmg-widget-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.wpmg-widget-item img {
    width: 100%;
    height: auto;
    transition: transform 0.3s;
}

.wpmg-widget-item:hover img {
    transform: scale(1.05);
}

.wpmg-widget-link {
    display: block;
}

.wpmg-widget-views {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 11px;
}

.wpmg-widget-footer {
    margin-top: 15px;
    text-align: center;
}

.wpmg-widget-view-all {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.3s;
}

.wpmg-widget-view-all:hover {
    background: #764ba2;
    color: white;
    transform: translateY(-2px);
}

/* ==================================================
   Animations
================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ==================================================
   Responsive Design
================================================== */

/* Tablet Styles */
@media (max-width: 992px) {
    .wpmg-gallery-grid,
    .wpmg-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    
    .wpmg-shorts-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .wpmg-gallery-container {
        padding: 15px;
    }
    
    .wpmg-gallery-grid,
    .wpmg-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .wpmg-filter-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .wpmg-search-input {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .wpmg-search-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .wpmg-image-card img {
        height: 220px;
    }
    
    .wpmg-lightbox-content {
        width: 95%;
    }
    
    .wpmg-lightbox-caption h3 {
        font-size: 16px;
    }
    
    .wpmg-lightbox-caption p {
        font-size: 13px;
    }
    
    .wpmg-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .wpmg-shorts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .wpmg-tab-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .wpmg-widget-gallery.wpmg-layout-grid {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .wpmg-gallery-grid,
    .wpmg-video-grid {
        grid-template-columns: 1fr;
    }
    
    .wpmg-shorts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wpmg-category-filters {
        gap: 8px;
    }
    
    .wpmg-filter-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    .wpmg-search-box {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .wpmg-lightbox-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 30px;
    }
    
    .wpmg-lightbox-caption {
        padding: 15px;
    }
    
    .wpmg-lightbox-caption h3 {
        font-size: 14px;
    }
    
    .wpmg-lightbox-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ==================================================
   Print Styles
================================================== */

@media print {
    .wpmg-category-filters,
    .wpmg-search-box,
    .wpmg-load-more,
    .wpmg-pagination,
    .wpmg-image-overlay {
        display: none !important;
    }
    
    .wpmg-gallery-grid {
        display: block;
    }
    
    .wpmg-image-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .wpmg-image-card img {
        max-width: 100%;
        height: auto;
    }
}

/* ==================================================
   Utility Classes
================================================== */

.wpmg-text-center {
    text-align: center;
}

.wpmg-hidden {
    display: none !important;
}

.wpmg-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==================================================
   Accessibility
================================================== */

.wpmg-filter-btn:focus-visible,
.wpmg-search-btn:focus-visible,
.wpmg-view-btn:focus-visible,
.wpmg-load-more:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.wpmg-image-card:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}