.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: white;
    text-align: left;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    min-width: 280px;
    max-width: 320px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%) translateY(-5px);
    backdrop-filter: blur(10px);
}

/* Tooltip alineado a la derecha para evitar desbordamiento */
.tooltip-right {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.tooltip-right::before {
    left: 20px;
    margin-left: 0;
}

/* Tooltip que se adapta automáticamente */
.tooltip-adaptive {
    left: 50%;
    transform: translateX(-50%);
}

/* Media query para pantallas pequeñas */
@media (max-width: 768px) {
    .tooltip-adaptive {
        left: auto;
        right: 0;
        transform: translateX(0);
        min-width: 250px;
        max-width: 280px;
    }
    
    .tooltip-adaptive::before {
        left: 30px;
        margin-left: 0;
    }
}

/* Tooltip inteligente que detecta el espacio disponible */
.tooltip-smart {
    left: 50%;
    transform: translateX(-50%);
}

/* Cuando el contenedor padre tiene la clase 'near-edge' */
.near-edge .tooltip-smart {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.near-edge .tooltip-smart::before {
    left: 20px;
    margin-left: 0;
}

.tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #374151 transparent transparent transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tooltip-container:hover .tooltip-right {
    transform: translateX(0) translateY(0);
}

.tooltip-container:hover .tooltip-adaptive {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .tooltip-container:hover .tooltip-adaptive {
        transform: translateX(0) translateY(0);
    }
}

.near-edge .tooltip-container:hover .tooltip-smart {
    transform: translateX(0) translateY(0);
}

.info-icon {
    transition: all 0.2s ease;
}

.tooltip-container:hover .info-icon {
    color: #3b82f6;
    transform: scale(1.1);
}

/* Versión alternativa con tema claro */
.tooltip-light {
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.tooltip-light::before {
    border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

/* Animación de entrada más suave */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.tooltip-animated {
    animation: tooltipFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tooltip-container:hover .tooltip-animated {
    animation: tooltipFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.drag-over {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 8px 12px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.file-item .file-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.file-item .file-remove {
    color: #dc2626;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.file-item .file-remove:hover {
    background-color: #fee2e2;
}