/*
===========================================
ESTILOS PARA PESSOAS E TOOLTIPS
===========================================
Arquivo: people-styles.css
Descrição: Estilos específicos para o sistema de pessoas
===========================================
*/

/* === CARDS DE PESSOAS === */
.person-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.person-card:hover {
    transform: translateY(-8px);
    z-index: 5;
}

.person-card .gallery-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Manter overflow hidden para a imagem */
    background: linear-gradient(135deg, var(--rich-black) 0%, var(--charcoal) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.person-card {
    /* Container do tooltip fora da imagem */
    overflow: visible;
}

.person-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: all 0.4s ease;
}

.person-card:hover .person-image {
    filter: brightness(1.1) contrast(1.05);
    transform: scale(1.05);
}

/* === TOOLTIP CONTAINER === */
#tooltip-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50000;
}

/* === TOOLTIPS === */
.person-tooltip {
    position: fixed;
    z-index: 50001;
    background: linear-gradient(135deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(20, 20, 20, 0.95) 100%
    );
    border: 2px solid var(--primary-gold);
    border-radius: 12px;
    padding: 16px;
    max-width: 320px;
    min-width: 250px;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(201, 176, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.person-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Seta do tooltip será adicionada dinamicamente via JavaScript */

.tooltip-content {
    position: relative;
    z-index: 1;
}

.tooltip-title {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-gold);
    margin: 0 0 12px 0;
    text-align: center;
    border-bottom: 1px solid rgba(201, 176, 55, 0.3);
    padding-bottom: 8px;
}

.tooltip-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tooltip-item {
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: 1.4;
    color: var(--soft-white);
    margin-bottom: 8px;
}

.tooltip-item strong {
    color: var(--primary-gold);
    font-weight: 500;
}

.tooltip-description {
    font-size: 13px;
    line-height: 1.5;
    color: #cccccc;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(201, 176, 55, 0.2);
}

/* === ESTADOS ESPECIAIS === */
.empty-state,
.error-state {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-content,
.error-content {
    max-width: 500px;
    color: var(--soft-white);
}

.empty-content h3,
.error-content h3 {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--primary-gold);
    margin-bottom: 1.5rem;
}

.empty-content p,
.error-content p {
    font-family: var(--font-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.empty-content code {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.empty-content ul {
    text-align: left;
    max-width: 280px;
    margin: 1.5rem auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem 1.5rem;
}

.empty-content li {
    margin: 0.5rem 0;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
}

.retry-button {
    background: var(--primary-gold);
    color: var(--deep-black);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-family: var(--font-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.retry-button:hover {
    background: var(--soft-white);
    color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

/* === LOADING STATE === */
.person-card.loading {
    pointer-events: none;
}

.person-card.loading .person-image {
    opacity: 0.5;
    filter: blur(2px);
}

.person-card.loading .gallery-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.person-card.loading .gallery-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

/* === ANIMAÇÕES === */
@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tooltipSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
}

.person-tooltip.entering {
    animation: tooltipSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.person-tooltip.leaving {
    animation: tooltipSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* === MODAL RESPONSIVE === */
@media (max-width: 1024px) {
    .gallery-modal-content {
        padding: 40px 20px 20px;
    }
    
    .modal-person-name {
        font-size: 28px;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .modal-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 32px;
    }
    
    .modal-person-name {
        font-size: 24px;
        padding-right: 60px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .person-details {
        padding: 20px;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-close {
        top: -50px;
        font-size: 28px;
    }

/* === RESPONSIVIDADE === */
    .person-tooltip {
        max-width: 250px;
        min-width: 200px;
        padding: 0.8rem;
        font-size: 0.85rem;
    }
    
    .tooltip-title {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .tooltip-item {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .tooltip-item strong {
        min-width: auto;
    }
    
    /* Em dispositivos móveis, mostrar tooltip no toque */
    .person-card:active .person-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .gallery-modal-content {
        padding: 20px 10px 10px;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .video-overlay {
        width: 60px;
        height: 60px;
    }
    
    .play-icon {
        font-size: 24px;
    }
    
    .person-tooltip {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 10px;
        max-width: 90vw;
    }
    
    .person-tooltip::before {
        top: -6px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }
    
    .empty-state,
    .error-state {
        min-height: 300px;
        padding: 2rem 1rem;
    }
    
    .empty-content h3,
    .error-content h3 {
        font-size: 1.5rem;
    }
}

/* === PERSON GALLERY MODAL === */
.person-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.person-gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px 40px;
    position: relative;
}

/* === MODAL HEADER === */
.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-person-name {
    font-family: var(--font-primary);
    font-size: 36px;
    color: var(--primary-gold);
    margin: 0;
    font-weight: 500;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--soft-white);
    font-size: 48px;
    cursor: pointer;
    padding: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-gold);
    transform: scale(1.1);
}

/* === MODAL INFO === */
.gallery-modal-info {
    margin-bottom: 40px;
}

.person-details {
    background: rgba(13, 13, 13, 0.8);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 12px;
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.detail-value {
    font-size: 16px;
    color: var(--soft-white);
    font-weight: 300;
}

.person-description h4 {
    font-family: var(--font-primary);
    font-size: 24px;
    color: var(--primary-gold);
    margin-bottom: 15px;
    font-weight: 500;
}

.person-description p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--soft-white);
    opacity: 0.9;
}

/* === MEDIA GRID === */
.gallery-modal-media {
    margin-top: 40px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.media-item {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.media-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 175, 55, 0.2);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-item:hover img {
    transform: scale(1.05);
}

.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

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

.play-icon {
    font-size: 32px;
    color: var(--primary-gold);
    margin-left: 6px;
}

/* === IMAGE LIGHTBOX === */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 30000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -60px;
    right: 0;
    background: none;
    border: none;
    color: var(--soft-white);
    font-size: 36px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    color: var(--primary-gold);
    transform: scale(1.2);
}

/* === LOADING STATE === */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-progress {
    width: 200px;
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--soft-white));
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* === MICRO-INTERAÇÕES === */
/* Removidas - usando novo sistema de hover com nome sempre visível */

/* === ACESSIBILIDADE === */
.person-card:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 4px;
}

.person-card:focus .person-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* === LOADING STATES === */
.media-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    grid-column: 1 / -1;
    color: var(--light-gray);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(218, 165, 32, 0.3);
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.no-media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    grid-column: 1 / -1;
    color: var(--light-gray);
    text-align: center;
}

/* === NOME SEMPRE VISÍVEL === */
.person-name-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 1rem;
    z-index: 3;
}

.person-name {
    margin: 0;
    color: var(--primary-gold);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

/* === HOVER OVERLAY === */
.gallery-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 4;
    backdrop-filter: blur(2px);
}

.hover-content {
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.hover-text {
    color: var(--primary-gold);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* === ESTADOS DE HOVER === */
.person-card:hover .gallery-hover-overlay {
    opacity: 1;
    visibility: visible;
}

.person-card:hover .hover-content {
    transform: translateY(0);
}

.person-card:hover .person-name-label {
    opacity: 0.3;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .person-name {
        font-size: 0.8rem;
    }
    
    .hover-text {
        font-size: 1rem;
    }
    
    .person-name-label {
        padding: 1.5rem 0.8rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .person-name {
        font-size: 0.75rem;
    }
    
    .hover-text {
        font-size: 0.9rem;
    }
}

/* === AJUSTES PARA CARDS DAS PESSOAS - NOME SEMPRE VISÍVEL === */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    transform: translateY(0) !important; /* Nome sempre visível - forçar */
    transition: all 0.3s ease;
}

.gallery-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 1 !important; /* Nome sempre visível - forçar */
    transition: all 0.3s ease;
    color: var(--primary-gold, #C9B037);
}

.gallery-category.gallery-hover-text {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0; /* Texto "Ver Galeria Completa" inicialmente oculto */
    transform: translateY(10px);
    transition: all 0.3s ease;
    color: var(--text-light, #f4f4f4);
}

/* Efeitos no hover */
.gallery-item:hover .gallery-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding-bottom: 25px;
}

.gallery-item:hover .gallery-category.gallery-hover-text {
    opacity: 1; /* Mostrar "Ver Galeria Completa" no hover */
    transform: translateY(0);
}

/* Melhorar o efeito de hover no card inteiro */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(201, 176, 55, 0.3);
}

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

/* Garantir que o overlay nunca seja empurrado para baixo */
.gallery-item .gallery-overlay {
    transform: translateY(0) !important;
}

/* Reduzir animações para usuários com preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .person-tooltip,
    .person-card,
    .person-image,
    .gallery-btn {
        transition-duration: 0.2s;
        animation-duration: 0.2s;
    }
    
    .person-card:hover {
        transform: none;
    }
    
    .person-tooltip.entering,
    .person-tooltip.leaving {
        animation: none;
        transition: opacity 0.2s ease;
    }
    
    .loading-spinner {
        animation: none;
        border: 3px solid var(--primary-gold);
    }
}