/* Portfolio Modal - Estilos Base con Layout de 2 Columnas */
#pf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 999999;
    overflow: hidden;
    padding: 30px;
}

#pf-modal-container {
    position: relative;
    max-width: 1400px;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 60px);
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header con botón de cerrar */
.pf-modal-header {
    padding: 0;
    border: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
}

.pf-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 15px 20px;
    transition: all 0.3s;
    border-radius: 0 12px 0 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pf-close-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Body con 2 columnas */
.pf-modal-body {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 0;
    flex: 1 1 auto;
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* Columna Izquierda: Galería */
.pf-modal-gallery-column {
    background: #f8f9fa;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #bbb #f8f9fa;
}

.pf-modal-gallery-column::-webkit-scrollbar {
    width: 8px;
}

.pf-modal-gallery-column::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.pf-modal-gallery-column::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.pf-modal-gallery-column::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Columna Derecha: Información */
.pf-modal-info-column {
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pf-modal-info-column::-webkit-scrollbar {
    width: 6px;
}

.pf-modal-info-column::-webkit-scrollbar-track {
    background: #fff;
}

.pf-modal-info-column::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.pf-modal-info-column::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Título en columna de información */
.pf-modal-title {
    margin: 0;
    color: #333;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
}

/* Meta info en columna de información */
.pf-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #666;
}

.pf-category-badge {
    background: #2196F3;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pf-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
}

/* Ocultar vistas y likes - solo mostrar año */
.pf-stat-item:not(#pf-year) {
    display: none !important;
}

.pf-stat-icon {
    font-size: 16px;
}

/* Galería en columna izquierda */
.pf-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pf-gallery-item {
    flex: 0 0 auto;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.pf-gallery-image,
.pf-gallery-video {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
}

.pf-gallery-image {
    background: #fff;
}

.pf-gallery-video {
    background: #000;
}

.pf-gallery-media {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
}

/* Para imágenes: mantener proporción sin distorsión */
.pf-gallery-media:not(video) {
    object-fit: contain;
}

/* Para videos: adaptarse al contenedor */
video.pf-gallery-media {
    width: 100%;
}

/* Imagen única en columna izquierda */
.pf-single-image-container {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 15px;
}

.pf-single-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Descripción en columna de información */
.pf-modal-description {
    line-height: 1.8;
    color: #555;
    font-size: 16px;
    margin: 0;
}

/* Sección de información */
.pf-info-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-info-section h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sección de videos */
.pf-videos-section {
    margin: 12px 0;
}

.pf-videos-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.pf-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.pf-video-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.pf-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Botón externo */
.pf-external-container {
    margin-top: auto;
    padding-top: 20px;
}

.pf-external-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2196F3;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    width: 100%;
    text-align: center;
}

.pf-external-button:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
    color: white;
}

.pf-external-button:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    #pf-modal {
        padding: 20px;
    }
    
    #pf-modal-container {
        max-height: calc(100vh - 40px);
    }
    
    .pf-modal-body {
        grid-template-columns: 50% 50%;
    }
}

@media (max-width: 768px) {
    #pf-modal {
        padding: 10px;
    }
    
    #pf-modal-container {
        max-height: calc(100vh - 20px);
        border-radius: 8px;
    }
    
    .pf-modal-header {
        padding: 15px 20px;
    }
    
    .pf-modal-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .pf-modal-gallery-column {
        padding: 20px;
        max-height: 300px;
    }
    
    .pf-modal-info-column {
        padding: 20px;
    }
    
    .pf-modal-title {
        font-size: 24px;
    }
}
