/* ==========================
   BOTONES BASE
========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md, 10px);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base, 250ms ease-in-out);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

/* Efecto de brillo que se mueve al hacer hover */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ==========================
   VARIANTES DE COLOR
========================== */

/* Primary - Púrpura moderno */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

/* Danger - Rojo elegante */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4);
}

/* Secondary - Gris sofisticado */
.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.btn-secondary:focus {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.4);
}

/* Info - Cyan vibrante */
.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.btn-info:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.4);
}

/* Success - Verde fresco */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4);
}

/* Warning - Amarillo/Naranja */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: 2px solid transparent;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.btn-warning:focus {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4);
}

/* ==========================
   VARIANTES OUTLINE (Contorno)
========================== */
.btn-outline-primary {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: #6366f1;
    color: #ffffff;
}

.btn-outline-danger {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    box-shadow: none;
}

.btn-outline-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-outline-secondary {
    background: transparent;
    color: #64748b;
    border: 2px solid #64748b;
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background: #64748b;
    color: #ffffff;
}

.btn-outline-info {
    background: transparent;
    color: #06b6d4;
    border: 2px solid #06b6d4;
    box-shadow: none;
}

.btn-outline-info:hover {
    background: #06b6d4;
    color: #ffffff;
}

/* ==========================
   VARIANTES GHOST (Fantasma)
========================== */
.btn-ghost {
    background: transparent;
    color: #6366f1;
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.1);
}

.btn-ghost-danger {
    background: transparent;
    color: #ef4444;
    border: none;
    box-shadow: none;
}

.btn-ghost-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================
   TAMAÑOS
========================== */
.btn-xs {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 8px;
}

.btn-md {
    padding: 12px 24px;
    font-size: 0.95rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
    border-radius: 12px;
}

.btn-xl {
    padding: 16px 40px;
    font-size: 1.15rem;
    border-radius: 14px;
}

/* ==========================
   BOTÓN DE ANCHO COMPLETO
========================== */
.btn-block {
    display: flex;
    width: 100%;
}

/* ==========================
   BOTÓN CON ICONO
========================== */
.btn-icon {
    padding: 12px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
}

.btn-icon-sm {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-icon-lg {
    padding: 16px;
    width: 52px;
    height: 52px;
}

/* ==========================
   ESTADOS ESPECIALES
========================== */

/* Disabled */
.btn:disabled,
.btn.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.btn:disabled::before,
.btn.disabled::before {
    display: none;
}

.btn:disabled:hover,
.btn.disabled:hover {
    background: #e2e8f0;
    transform: none;
    box-shadow: none;
}

/* Loading */
.btn-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================
   GRUPOS DE BOTONES
========================== */
.btn-group {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-group-attached {
    display: inline-flex;
    gap: 0;
}

.btn-group-attached .btn {
    border-radius: 0;
    margin-left: -2px;
}

.btn-group-attached .btn:first-child {
    border-radius: var(--radius-md, 10px) 0 0 var(--radius-md, 10px);
    margin-left: 0;
}

.btn-group-attached .btn:last-child {
    border-radius: 0 var(--radius-md, 10px) var(--radius-md, 10px) 0;
}

.btn-group-attached .btn:only-child {
    border-radius: var(--radius-md, 10px);
}

/* ==========================
   BOTONES CON ANIMACIONES ESPECIALES
========================== */

/* Efecto de pulso para llamar atención */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

/* Efecto de rebote al hacer hover */
.btn-bounce:hover {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-2px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Efecto de shake para errores */
.btn-shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ==========================
   RESPONSIVE
========================== */
@media screen and (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .btn-lg {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 7px 14px;
        font-size: 0.85rem;
    }
    
    /* En móvil, los botones pueden ser de ancho completo más fácilmente */
    .btn-mobile-block {
        display: flex;
        width: 100%;
    }
}