/* 
 * KUPSEA Gallery & Blog Styles
 * Version: 2.3
 * Description: Enhanced styles for gallery and blog sections
 */

/* Root Variables */
:root {
    --primary-color: #1c6da3;;
    --secondary-color: #3498db;
    --text-color: #333;
    --white: #fff;
    --light-bg: #f5f5f5;
    --shadow-color: rgba(0,0,0,0.1);
    --transition-fast: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Main Layout */
.gallery-content-wrapper {
    padding: 2rem 1rem;
    min-height: 100vh;
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Gallery Section */
.gallery-section {
    margin-bottom: 4rem;
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: white;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover,
.filter-btn:focus {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-within .gallery-overlay {
    opacity: 1;
}

.gallery-title {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.gallery-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
}

.view-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.view-btn:hover,
.view-btn:focus {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
}

.blog-search {
    margin-bottom: 2rem;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

#blog-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
}

#blog-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

#blog-search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

#blog-search-btn:hover,
#blog-search-btn:focus {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    padding: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1;
    transition: all var(--transition-speed) ease;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lightbox-title {
    color: white;
    text-align: center;
    margin-top: 1rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Pagination Styles */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.pagination-btn:not(.disabled):hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    margin: 0 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-container {
        padding: 0 2rem;
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-content-wrapper {
        padding: 1rem;
    }
    
    .gallery-container {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card-content {
        padding: 1rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gallery-item {
    animation: fadeIn 0.5s ease forwards, slideUp 0.5s ease forwards;
}

/* Animation delays for grid items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

/* Blog Section Transitions */
#blog-content {
    transition: opacity 0.3s ease;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
#blog-content.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error State */
.no-content.error {
    background-color: #fff5f5;
    border: 1px solid #ffebee;
}

.no-content.error .no-content-icon {
    color: #dc3545;
}