/**
 * Pandora Portfolio - Estilos del Widget
 * 
 * @package Pandora_Portfolio
 * @version 1.0.0
 */

/* ========================================
   RESET Y BASE
======================================== */
.pandora-portfolio-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.pandora-portfolio-wrapper * {
    box-sizing: border-box;
}

/* ========================================
   GRID LAYOUT
======================================== */
.pandora-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .pandora-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .pandora-portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ========================================
   TARJETA (CARD)
======================================== */
.pandora-portfolio-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Efecto Antigravity - Hover */
.pandora-portfolio-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ========================================
   IMAGEN
======================================== */
.pandora-portfolio-card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f5f5f5;
}

.pandora-portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pandora-portfolio-card:hover .pandora-portfolio-card-image img {
    transform: scale(1.08);
}

/* Overlay de la imagen */
.pandora-portfolio-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pandora-portfolio-card-image:hover .pandora-portfolio-image-overlay {
    opacity: 1;
}

/* Botón de zoom */
.pandora-portfolio-zoom-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

.pandora-portfolio-zoom-button:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.pandora-portfolio-zoom-button svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   CONTENIDO DE LA TARJETA
======================================== */
.pandora-portfolio-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Título (Nombre de la compañía) */
.pandora-portfolio-card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Descripción */
.pandora-portfolio-card-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666666;
    margin: 0 0 16px 0;
    flex-grow: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ========================================
   BADGES (ETIQUETAS)
======================================== */
.pandora-portfolio-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.pandora-portfolio-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f0f0;
    color: #555555;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.pandora-portfolio-card:hover .pandora-portfolio-badge {
    background: #e5e5e5;
}

/* ========================================
   BOTÓN
======================================== */
.pandora-portfolio-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin-top: auto;
}

.pandora-portfolio-button:hover {
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pandora-portfolio-button:active {
    transform: translateY(0);
}

.pandora-portfolio-button i,
.pandora-portfolio-button svg {
    margin-left: 8px;
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ========================================
   MODAL POPUP
======================================== */
.pandora-portfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pandora-portfolio-modal.active {
    display: flex;
}

/* Overlay del modal */
.pandora-portfolio-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    animation: pandoraFadeIn 0.3s ease;
}

/* Contenido del modal */
.pandora-portfolio-modal-content {
    position: relative;
    z-index: 1;
    max-width: 95%;
    max-height: 95vh;
    animation: pandoraZoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botón de cerrar */
.pandora-portfolio-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.pandora-portfolio-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.pandora-portfolio-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Wrapper de la imagen del modal */
.pandora-portfolio-modal-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Imagen del modal */
.pandora-portfolio-modal-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* ========================================
   ANIMACIONES
======================================== */
@keyframes pandoraFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pandoraZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVE AJUSTES
======================================== */
@media (max-width: 767px) {
    .pandora-portfolio-card-content {
        padding: 20px;
    }
    
    .pandora-portfolio-card-title {
        font-size: 20px;
    }
    
    .pandora-portfolio-card-description {
        font-size: 14px;
    }
    
    .pandora-portfolio-card-image {
        height: 220px;
    }
    
    .pandora-portfolio-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .pandora-portfolio-modal-content {
        max-width: 100%;
    }
}

/* ========================================
   ACCESIBILIDAD
======================================== */
.pandora-portfolio-button:focus,
.pandora-portfolio-zoom-button:focus,
.pandora-portfolio-modal-close:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .pandora-portfolio-card,
    .pandora-portfolio-card-image img,
    .pandora-portfolio-button,
    .pandora-portfolio-badge,
    .pandora-portfolio-zoom-button,
    .pandora-portfolio-modal-close {
        transition: none;
        animation: none;
    }
    
    .pandora-portfolio-card:hover {
        transform: none;
    }
}

/* ========================================
   MODO OSCURO (OPCIONAL)
======================================== */
@media (prefers-color-scheme: dark) {
    .pandora-portfolio-card {
        background: #1e1e1e;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .pandora-portfolio-card:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }
    
    .pandora-portfolio-card-title {
        color: #ffffff;
    }
    
    .pandora-portfolio-card-description {
        color: #b0b0b0;
    }
    
    .pandora-portfolio-badge {
        background: #2a2a2a;
        color: #d0d0d0;
    }
    
    .pandora-portfolio-card:hover .pandora-portfolio-badge {
        background: #333333;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .pandora-portfolio-modal,
    .pandora-portfolio-zoom-button,
    .pandora-portfolio-button {
        display: none !important;
    }
    
    .pandora-portfolio-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
