/* ============================================================
   POPUP MODAL - Modern Popup System
   Sistema de popup moderno con animaciones suaves
   ============================================================ */

/* Overlay - Backdrop oscuro */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container - Contenedor del popup */
.popup-container {
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    background: white;
    border-radius: 12.8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Content - Contenido principal */
.popup-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 19.2px 25.6px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
}

.popup-header-content {
    display: flex;
    align-items: center;
    gap: 12.8px;
}

.popup-icon {
    width: 44.8px;
    height: 44.8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 9.6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3.2px 9.6px rgba(59, 130, 246, 0.3);
}

.popup-icon .material-icons {
    font-size: 25.6px;
    color: white;
}

.popup-title-group {
    display: flex;
    flex-direction: column;
    gap: 3.2px;
}

.popup-title {
    font-size: 19.2px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

.popup-subtitle {
    display: flex;
    align-items: center;
    gap: 4.8px;
    font-size: 11.2px;
    color: #64748b;
    margin: 0;
}

.popup-subtitle .material-icons {
    font-size: 14.4px;
    color: #94a3b8;
}

.popup-close {
    width: 32px;
    height: 32px;
    border-radius: 6.4px;
    border: none;
    background: white;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.popup-close:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: rotate(90deg);
}

.popup-close .material-icons {
    font-size: 19.2px;
}

/* Body */
.popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 25.6px;
    background: white;
}

/* Custom Scrollbar */
.popup-body::-webkit-scrollbar {
    width: 6.4px;
}

.popup-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3.2px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3.2px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Footer */
.popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9.6px;
    padding: 16px 25.6px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-shrink: 0;
}

/* Buttons */
.btn-popup-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6.4px;
    padding: 8px 16px;
    border-radius: 6.4px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    font-size: 11.2px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-popup-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.btn-popup-secondary .material-icons {
    font-size: 14.4px;
}

/* Stats Cards dentro del popup */
.popup-body .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-body .card:hover {
    transform: translateY(-1.6px);
    box-shadow: 0 6.4px 12.8px rgba(0, 0, 0, 0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .popup-container {
        max-height: 95vh;
        border-radius: 12.8px 12.8px 0 0;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }

    .popup-header {
        padding: 16px;
    }

    .popup-icon {
        width: 38.4px;
        height: 38.4px;
    }

    .popup-icon .material-icons {
        font-size: 22.4px;
    }

    .popup-title {
        font-size: 16px;
    }

    .popup-body {
        padding: 16px;
    }

    .popup-footer {
        padding: 12.8px 16px;
    }
}

@media (max-width: 640px) {
    .popup-header-content {
        gap: 9.6px;
    }

    .popup-icon {
        width: 32px;
        height: 32px;
    }

    .popup-icon .material-icons {
        font-size: 19.2px;
    }

    .popup-title {
        font-size: 14.4px;
    }

    .popup-subtitle {
        font-size: 11px;
    }
}
