/**
 * Archive Gallery Styles
 * Custom styles for gallery archive template
 */

:root {
    --primary-gradient: linear-gradient(135deg, #ff6b35 0%, #fc9837 100%);
    --primary-color: #ff6b35;
    --secondary-color: #fc9837;
}

/* Gallery Archive Header */
.gallery-archive-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 60px 0;
    margin-bottom: 40px;
    color: white;
    text-align: center;
}

.gallery-archive-header .archive-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    color: white;
}

.gallery-archive-header .archive-title i {
    color: var(--primary-color);
    margin-right: 10px;
}

.gallery-archive-header .archive-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gallery Section */
.gallery-section {
    margin-bottom: 50px;
}

/* Section Title */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.section-title i {
    color: var(--primary-color);
    font-size: 22px;
}

/* Gallery Filter Tabs */
.gallery-filter-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-tab:hover {
    background: #fff5f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.gallery-tab.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.gallery-tab i {
    font-size: 16px;
}

.gallery-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.gallery-tab.active .gallery-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Gallery Stats - Made Compact */
.gallery-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.15);
}

.stat-card i {
    font-size: 28px;
    color: var(--primary-color);
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* Gallery Grid - Square Layout with Download Icon */
.gallery-masonry-grid,
#allGalleryGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

#allGalleryGrid .cat_grid_item {
    width: 100%;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
}

.gallery-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Gallery Thumbnail - Square with Overlay Fix */
.gallery-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Square ratio */
    overflow: hidden;
    background: #f8fafc;
}

.gallery-thumbnail a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumbnail img {
    transform: scale(1.05);
}

/* Gallery Overlay - Fixed to not block clicks */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Fix: overlay không chặn click */
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 36px;
    color: white;
    margin-bottom: 5px;
}

.gallery-overlay span {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Download Icon Badge */
.gallery-thumbnail::after {
    content: '\f019'; /* Font Awesome download icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-thumbnail::after {
    transform: scale(1.1);
}

/* Gallery Content */
.gallery-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.gallery-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-title a:hover {
    color: var(--primary-color);
}

.gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.gallery-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gallery-meta i {
    color: var(--primary-color);
}

/* Category Overview Cards */
.gallery-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 30px;
}

.category-overview-card {
    background: white;
    border-radius: 12px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
}

.category-overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.15);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.category-overview-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.category-overview-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

.category-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* No Results Message */
#noResultsMessage {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

#noResultsMessage p {
    font-size: 16px;
    color: #666;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 40px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery-masonry-grid,
    #allGalleryGrid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .gallery-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-archive-header {
        padding: 40px 20px;
    }

    .gallery-archive-header .archive-title {
        font-size: 28px;
    }

    .gallery-archive-header .archive-description {
        font-size: 14px;
    }

    .gallery-filter-tabs {
        flex-direction: column;
    }

    .gallery-tab {
        width: 100%;
        justify-content: center;
    }

    /* Mobile: 2 columns as requested */
    .gallery-masonry-grid,
    #allGalleryGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .gallery-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-card i {
        font-size: 24px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 11px;
    }

    .gallery-content {
        padding: 12px;
    }

    .gallery-title {
        font-size: 14px;
    }

    .gallery-meta {
        font-size: 11px;
    }

    .gallery-categories-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-title {
        font-size: 20px;
    }
}

/* Featured Galleries Section */
#featured_galleries {
    margin-bottom: 40px;
}

.galleries-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.galleries-grid.featured-galleries {
    grid-template-columns: repeat(3, 1fr);
}

/* Gallery Card Styles */
.gallery-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gallery-card.featured {
    border: 2px solid var(--primary-color);
}

/* Gallery Card Header */
.gallery-card-header {
    position: relative;
    overflow: hidden;
}

.gallery-card .gallery-thumbnail {
    padding-top: 75%; /* 4:3 ratio for featured */
}

#allGalleryGrid .gallery-card .gallery-thumbnail {
    padding-top: 100%; /* 1:1 ratio for all galleries */
}

.gallery-card .gallery-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-thumbnail img {
    transform: scale(1.05);
}

/* Remove ::after for gallery-card to use badge instead */
.gallery-card .gallery-thumbnail::after {
    display: none;
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.featured-badge i {
    font-size: 12px;
}

/* Download Badge */
.download-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    transition: transform 0.3s ease;
}

.gallery-card:hover .download-badge {
    transform: scale(1.1);
}

/* Gallery Card Body */
.gallery-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-card .gallery-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.4;
}

.gallery-card .gallery-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-card .gallery-title a:hover {
    color: var(--primary-color);
}

.gallery-card .gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
    margin-top: auto;
}

.gallery-card .gallery-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gallery-card .gallery-meta i {
    color: var(--primary-color);
    font-size: 14px;
}

/* Gallery Card Overlay */
.gallery-card .gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-card .gallery-overlay i {
    font-size: 36px;
    color: white;
}

.gallery-card .gallery-overlay span {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* Responsive for Gallery Cards */
@media (max-width: 1024px) {
    .galleries-grid,
    .galleries-grid.featured-galleries {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .galleries-grid,
    .galleries-grid.featured-galleries {
        grid-template-columns: 1fr;
    }

    .gallery-card-body {
        padding: 16px;
    }

    .gallery-card .gallery-title {
        font-size: 16px;
    }
}
