/* ================================================
   GALERIA MODERNA - CSS MINIMALISTA MELHORADO
   ================================================ */

:root {
    --gallery-primary: #2563eb;
    --gallery-secondary: #64748b;
    --gallery-accent: #f8fafc;
    --gallery-border: #e2e8f0;
    --gallery-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --gallery-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --gallery-shadow-xl: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
    --gallery-radius: 16px;
    --gallery-radius-sm: 8px;
    --gallery-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gallery-hover-scale: 1.02;
}

/* ================================================
   CONTROLES DA GALERIA MELHORADOS
   ================================================ */
.gallery-section {
    padding: 4rem 0;
}

.gallery-controls {
	display: flex;
	justify-content: right;
	margin-bottom: 1rem;
}

.view-filters {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    position: relative;
    background-color: #fff;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--gallery-secondary);
    border-radius: var(--gallery-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--gallery-transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.view-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    transition: var(--gallery-transition);
    z-index: -1;
}

.view-btn:hover {
    color: #fb6e1d;
    transform: translateY(-2px);
}

.view-btn:hover::before {
    transform: translateX(0);
}

.view-btn.active {
	background: transparent;
	color: #fb6e1d !important;
	/* box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3); */
	transform: translateY(-1px);
}
.view-btn.active::before {
    transform: translateX(0);
}

.view-btn i {
    font-size: 1.125rem;
}

/* ================================================
   CONTAINER DE ÁLBUNS
   ================================================ */
.albums-container {
    transition: var(--gallery-transition);
    min-height: 400px;
}

/* ================================================
   VISUALIZAÇÃO EM GRADE MELHORADA
   ================================================ */
.albums-container.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0;
}

/* ================================================
   VISUALIZAÇÃO EM LISTA MELHORADA
   ================================================ */
.albums-container.view-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0;
}

.albums-container.view-list .album-card {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: var(--gallery-radius);
    box-shadow: var(--gallery-shadow);
    overflow: hidden;
    border: 1px solid var(--gallery-border);
    transition: var(--gallery-transition);
}

.albums-container.view-list .album-card:hover {
    transform: translateX(8px);
    box-shadow: var(--gallery-shadow-lg);
    border-color: var(--gallery-primary);
}

.albums-container.view-list .album-thumbnail {
    width: 240px;
    height: auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.albums-container.view-list .album-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--gallery-transition);
}

.albums-container.view-list .album-card:hover .album-thumbnail img {
    transform: scale(1.05);
}

.albums-container.view-list .album-overlay {
    position: static;
    background: none;
    padding: 2rem;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
}

.albums-container.view-list .album-info {
    flex: 1;
}

.albums-container.view-list .album-title {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.albums-container.view-list .album-count {
    color: var(--gallery-secondary);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.albums-container.view-list .album-count::before {
    content: '📸';
    font-size: 1.2rem;
}

.albums-container.view-list .album-action {
    padding: 1rem 1.25rem;
    background: var(--gallery-primary);
    color: white;
    border-radius: var(--gallery-radius-sm);
    font-weight: 600;
    transition: var(--gallery-transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.albums-container.view-list .album-action:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

/* ================================================
   VISUALIZAÇÃO EM MOSAICO MELHORADA
   ================================================ */
.albums-container.view-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: auto;
  gap: 1.5rem;
  padding: 1rem;
}

.albums-container.view-mosaic .album-item {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.albums-container.view-mosaic .album-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.albums-container.view-mosaic .album-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.albums-container.view-mosaic .album-card:nth-child(6n+1) {
    grid-row: span 2;
    grid-column: span 1;
}

.albums-container.view-mosaic .album-card:nth-child(6n+3) {
    grid-column: span 2;
    grid-row: span 1;
}

.albums-container.view-mosaic .album-card:nth-child(6n+5) {
    grid-row: span 2;
}

/* ================================================
   CARDS DE ÁLBUM MELHORADOS
   ================================================ */
.album-card {
    position: relative;
    border-radius: var(--gallery-radius);
    overflow: hidden;
    background: white;
    box-shadow: var(--gallery-shadow);
    border: 1px solid var(--gallery-border);
    cursor: pointer;
    transition: var(--gallery-transition);
    transform-origin: center;
    min-height: 17rem;
}

.album-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: var(--gallery-transition);
    z-index: 1;
}

.album-card:hover {
    transform: translateY(-8px) scale(var(--gallery-hover-scale));
    box-shadow: var(--gallery-shadow-xl);
    border-color: var(--gallery-primary);
}

.album-card:hover::before {
    opacity: 1;
}

.album-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.album-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--gallery-transition);
    filter: brightness(1.1) contrast(1.05);
}

.album-card:hover .album-thumbnail img {
    transform: scale(1.08);
    filter: brightness(1.2) contrast(1.1);
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gallery-accent), #e2e8f0);
    color: var(--gallery-secondary);
    gap: 1rem;
}

.no-image i {
    font-size: 4rem;
    opacity: 0.6;
}

.no-image span {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================
   OVERLAY DOS ÁLBUNS MELHORADO
   ================================================ */
.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: white;
    padding: 2.5rem 2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    transition: var(--gallery-transition);
    z-index: 3;
}

.album-card:hover .album-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding-bottom: 2.5rem;
}

.album-info {
    flex: 1;
    transform: translateY(10px);
    transition: var(--gallery-transition);
}

.album-card:hover .album-info {
    transform: translateY(0);
}

.album-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.album-count {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.album-count::before {
    content: '📷';
    font-size: 1.1rem;
}

.album-action {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--gallery-radius-sm);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--gallery-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(10px);
    opacity: 0.8;
}

.album-card:hover .album-action {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(0) scale(1.1);
    opacity: 1;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.album-action i {
    font-size: 1.375rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ================================================
   VISUALIZAÇÃO DE ÁLBUM
   ================================================ */
.albums-container.album-view {
    transition: var(--gallery-transition);
}

/* Cabeçalho do álbum - Sempre fora dos controles */
.album-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gallery-border);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: var(--gallery-accent);
    color: var(--gallery-secondary);
    border-radius: var(--gallery-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--gallery-transition);
    margin-right: 1.5rem;
}

.back-btn:hover {
    background: #e2e8f0;
    color: var(--gallery-primary);
}

.album-current-title {
    font-size: 1.5rem;
    color: #1e293b;
    margin: 0;
    flex: 1;
    font-weight: 600;
}

/* Grid de itens do álbum */
.album-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.item-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--gallery-radius);
    aspect-ratio: 1 / 1;
    cursor: pointer;
    box-shadow: var(--gallery-shadow);
    transition: var(--gallery-transition);
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--gallery-shadow-lg);
}

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

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

/* Estado de carregamento */
.albums-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10;
    border-radius: var(--gallery-radius);
}

.albums-container.loading::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    margin-left: -25px;
    margin-top: -25px;
    border: 3px solid rgba(37, 99, 235, 0.3);
    border-top-color: var(--gallery-primary);
    border-radius: 50%;
    z-index: 11;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================================
   ESTADO VAZIO
   ================================================ */
.no-albums {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gallery-secondary);
}

.no-albums i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-albums h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.no-albums p {
    font-size: 1rem;
    margin: 0;
}

/* ================================================
   ANIMAÇÕES
   ================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.album-card {
    animation: fadeInUp 0.6s ease forwards;
}

.album-card:nth-child(1) { animation-delay: 0.1s; }
.album-card:nth-child(2) { animation-delay: 0.2s; }
.album-card:nth-child(3) { animation-delay: 0.3s; }
.album-card:nth-child(4) { animation-delay: 0.4s; }
.album-card:nth-child(5) { animation-delay: 0.5s; }
.album-card:nth-child(6) { animation-delay: 0.6s; }

/* ================================================
   RESPONSIVIDADE
   ================================================ */
@media (max-width: 1024px) {
    .albums-container.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .albums-container.view-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .gallery-section {
        padding: 2rem 0;
    }
    
    .albums-container.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .albums-container.view-list .album-card {
        flex-direction: column;
    }
    
    .albums-container.view-list .album-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .albums-container.view-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }
    
    .albums-container.view-mosaic .album-card:nth-child(3n+1),
    .albums-container.view-mosaic .album-card:nth-child(5n+2) {
        grid-row: span 1;
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .view-btn span {
        display: none;
    }
    
    .view-btn {
        padding: 0.75rem;
    }
    
    .albums-container.view-grid {
        grid-template-columns: 1fr;
    }
    
    .album-thumbnail {
        height: 200px;
    }
}
