/* Gallery Page Styles */

/* Gallery Hero */
.gallery-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: 80px;
    overflow: hidden;
}

.gallery-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gallery-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-hero-bg .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(231,76,60,0.6) 100%);
}

.gallery-hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.gallery-hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Gallery Filters */
.gallery-filters {
    padding: 40px 0;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.gallery-filters .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

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

.filter-search {
    position: relative;
    min-width: 300px;
}

.filter-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition);
}

.filter-search input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.filter-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Gallery Grid */
.gallery-grid-section {
    padding: 60px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 280px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: scale(1);
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

.gallery-item-overlay h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.gallery-item-overlay p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    opacity: 0.8;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.15s;
}

.gallery-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.2s;
}

.gallery-item-tags span {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.gallery-item-overlay .btn {
    align-self: flex-start;
    transform: translateY(20px);
    transition: all 0.3s ease 0.25s;
}

.gallery-item:hover .gallery-item-overlay h3,
.gallery-item:hover .gallery-item-overlay p,
.gallery-item:hover .gallery-item-tags,
.gallery-item:hover .gallery-item-overlay .btn {
    transform: translateY(0);
}

/* Gallery Load More */
.gallery-load-more {
    text-align: center;
}

#load-more {
    min-width: 200px;
}

#load-more.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    padding-left: 40px;
}

#load-more.loading::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Gallery Stats */
.gallery-stats {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-card {
    padding: 20px;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: 50px auto;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 40px;
    animation: modalFadeIn 0.5s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

.modal-body {
    margin-top: 20px;
}

/* Project Detail Modal Content */
.project-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.project-detail-gallery {
    position: relative;
}

.project-detail-main-image {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.project-detail-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-detail-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.project-detail-thumbnail {
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

.project-detail-thumbnail.active,
.project-detail-thumbnail:hover {
    opacity: 1;
}

.project-detail-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-detail-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.project-detail-category {
    display: inline-block;
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--secondary-color);
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.project-detail-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.project-detail-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spec-item i {
    font-size: 1.2rem;
    color: var(--secondary-color);
    width: 30px;
}

.spec-item-content {
    flex: 1;
}

.spec-item-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec-item-value {
    font-weight: 600;
}

.project-detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-hero-title {
        font-size: 2.5rem;
    }
    
    .gallery-filters .container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-container {
        justify-content: center;
    }
    
    .filter-search {
        min-width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gallery-hero-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .project-detail-specs {
        grid-template-columns: 1fr;
    }
}