/* Album Gallery Page Specific Styles */

/* Album Cover Section */
.album-cover-section {
    position: relative;
    height: 50vh;
    min-height: 400px;
    overflow: hidden; /* Account for fixed navbar */
}

.album-cover-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(221, 69, 84, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* Back Button */
.back-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateX(-5px);
}

.back-button i {
    font-size: 1.1rem;
}

/* Album Info Section */
.album-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.album-header {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.album-header.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.album-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.album-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 400;
}

.album-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.album-description {
    max-width: 600px;
    margin: 0 auto;
}

.album-description p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0;
}

/* Gallery Section */
.gallery-section {
    background: #ffffff;
}

.gallery-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.view-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(221, 69, 84, 0.4);
}

/* Load More Button */
.load-more-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(221, 69, 84, 0.3);
}

/* Image Modal Styles */
.modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem 0;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

#modalImage {
    max-height: 80vh;
    object-fit: contain;
}

.modal-caption {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem;
    margin: 0;
}

.modal-nav-buttons {
    display: flex;
    gap: 1rem;
}

.modal-nav-buttons .btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .album-cover-section {
        height: 40vh;
        min-height: 300px;
    }
    
    .back-button-container {
        top: 15px;
        left: 15px;
    }
    
    .back-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .album-title {
        font-size: 2.5rem;
    }
    
    .album-subtitle {
        font-size: 1.2rem;
    }
    
    .album-meta {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .album-description p {
        font-size: 1rem;
    }
    
    .gallery-column {
        gap: 6px;
    }
    
    .view-btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .load-more-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .album-title {
        font-size: 2rem;
    }
    
    .album-subtitle {
        font-size: 1.1rem;
    }
    
    .back-button span {
        display: none;
    }
    
    .back-button {
        width: 45px;
        height: 45px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

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

/* Masonry-like effect for different image heights */
.left-column .gallery-item:nth-child(2n) {
    margin-top: 4px;
}

.right-column .gallery-item:nth-child(2n+1) {
    margin-top: 6px;
}

/* Smooth scrolling for the page */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Loading animation for gallery images only */
.gallery-item .gallery-image {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
    transition: opacity 0.3s ease;
}

/* Optimize compressed image loading */
.gallery-image {
    background: #f8f9fa;
    min-height: 200px;
}

.gallery-image[src*="compressed"] {
    filter: brightness(1.02) contrast(1.02);
}

/* Ensure cover image is always visible */
.cover-image {
    opacity: 1 !important;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Hover effect for the entire page */
.gallery-item {
    cursor: pointer;
}

/* Focus states for accessibility */
.view-btn:focus,
.back-button:focus,
.load-more-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .back-button-container,
    .load-more-btn,
    .modal {
        display: none !important;
    }
    
    .album-cover-section {
        margin-top: 0;
        height: auto;
        page-break-after: always;
    }
    
    .gallery-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}