/**
 * Estilos para iconos SVG
 */

/* Tamaños de iconos */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

/* Div enmascarado para heredar color */
.icon-mask {
    background-color: currentColor;
    -webkit-mask-image: var(--icon-url);
    mask-image: var(--icon-url);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.icon-sm,
.icon-mask.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg,
.icon-mask.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-xl,
.icon-mask.icon-xl {
    width: 2rem;
    height: 2rem;
}

/* Iconos en botones usando mask-image para heredar color */
.btn .icon-mask {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.btn-sm .icon-mask {
    width: 1rem;
    height: 1rem;
}

.btn-lg .icon-mask {
    width: 1.5rem;
    height: 1.5rem;
}

/* Icono solo (sin texto) */
.btn-icon {
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
}

.btn-icon:hover {
    opacity: 0.7;
}

.btn-icon .icon-mask {
    margin: 0;
}

/* Modal close button */
.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition, all 0.3s ease);
    color: inherit;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-close .icon-mask {
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
}

/* Botón de eliminar en cards */
.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
    padding: 0;
    color: #ef4444;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-remove .icon-mask {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

/* Animación de rotación para refresh */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-spin,
.btn:active .icon-refresh {
    animation: rotate 0.6s linear infinite;
}

/* Asegurar que los SVG hereden el color del texto */
svg {
    stroke: currentColor;
}

/* Eliminar espacio extra en SVGs inline */
.btn svg:last-child {
    margin-right: 0;
}

.btn svg:first-child:last-child {
    margin-right: 0;
}
