/* ============================================
   COMPONENTE: BUTTONS
   Estilos de botones reutilizables
   ============================================ */

/* ===== BUTTON BASE ===== */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    border: none;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn i {
    font-size: 0.85em;
}

/* ===== PRIMARY BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== SUCCESS BUTTONS ===== */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* ===== DANGER BUTTONS ===== */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* ===== WARNING BUTTONS ===== */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-warning:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* ===== INFO BUTTONS ===== */
.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    color: white !important;
    border: none !important;
}

.btn-info:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.35);
}

/* ===== SECONDARY BUTTONS ===== */
.btn-secondary {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1.5px solid #667eea !important;
    color: #667eea !important;
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #764ba2 !important;
}

/* ===== OUTLINE BUTTONS ===== */
.btn-outline-primary {
    background: transparent;
    border: 1.5px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
}

.btn-outline-success {
    background: transparent;
    border: 1.5px solid #10b981;
    color: #10b981;
}

.btn-outline-success:hover {
    background: rgba(16, 185, 129, 0.1);
}

.btn-outline-danger {
    background: transparent;
    border: 1.5px solid #ef4444;
    color: #ef4444;
}

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

/* ===== LIGHT BUTTON ===== */
.btn-light {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}

.btn-light:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ===== ADD BUTTONS (Special) ===== */
.btn-add,
.btn-add-platform,
.btn-add-category {
    background: transparent;
    border: 2px dashed #667eea;
    color: #667eea;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Botón add-user compacto para tablas */
.btn-add-user {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid #667eea;
    background: white;
    color: #667eea;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
}

.btn-add:hover,
.btn-add-platform:hover,
.btn-add-category:hover {
    background: #667eea;
    border-style: solid;
    color: white;
}

.btn-add-user:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* Botón add compacto (icono pequeño) */
.btn-add-sm {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0;
}

.btn-add-sm:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* ===== ICON BUTTONS ===== */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn-icon i {
    margin: 0;
    font-size: 0.85rem;
}

/* ===== BUTTON SIZES ===== */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 10px;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 5px;
}

/* ===== BUTTON STATES ===== */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ===== BUTTON GROUPS ===== */
.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 991.98px) {
    .btn {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        min-height: 34px;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.82rem;
        min-height: 42px;
        border-radius: 10px;
    }
    
    .btn-sm {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .btn-lg {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
}

/* Móvil pequeño - Touch targets completos */
@media (max-width: 575.98px) {
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        border-radius: 12px;
    }
    
    .btn-sm {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .btn-xs {
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    /* Botones en grupo - más espacio */
    .btn-group .btn {
        min-height: 44px;
    }
    
    /* Icono en botones más visible */
    .btn i {
        font-size: 0.95em;
    }
}

/* ===== DESACTIVAR HOVER ANIMATIONS EN DISPOSITIVOS TÁCTILES ===== */
@media (hover: none) {
    .btn-primary:hover,
    .btn-success:hover,
    .btn-danger:hover,
    .btn-warning:hover,
    .btn-info:hover {
        transform: none !important;
    }
}
